Understanding Ethereum Token Standards | HackerNoon

United States News News

Understanding Ethereum Token Standards | HackerNoon
United States Latest News,United States Headlines

'Understanding Ethereum Token Standards' web3 oct_network

Tokens are the most important and most used interfaces on the Ethereum platform and web3 environment. It is, for this reason, they are standardized to ensure smart contracts remain composable.It is a standard interface for Fungible tokens such as virtual currencies.

This standard allows developers to build token applications that are interoperable with other products and services.It is a standard interface for Non-Fungible Tokens which may include artwork or songs. Used to identify something or someone uniquely.Allows developers to build extra functionality on top of tokens for improved transactions privacy or emergency recovery options.A Deep Dive Into the standards Now with a brief introduction to the types of tokens on the Ethereum protocol, let’s do a deep dive into each of them and look at their nitty-gritty details. Note: These are not the actual details on how to create the token but an explanation on the engineering used to create the token. Things only get interesting onwards😀.This standard defines methods and events that should be implemented on a smart contract. A contract implementing these standards is called an ERC-20 Token Contract. It will create, monitor and perform operations on the token on the Ethereum protocol. This standard specifies the following methods: ///returns the name of the token which may or may not be present. function name public view returns ///returns the symbol of the token which also may or may not be present. function symbol public view returns ///returns the number of decimals which determines the lowest possible unit the token can accept. ///[Wei - Eth] function decimals public view returns ///returns the total token supply defined during creation. function totalSupply public view returns ///returns the number of tokens a given address has. function balanceOf public view returns ///transfers _value amount of tokens to address _to, and fires the Transfer event. function transfer public returns ///transfers _value amount of tokens from an address to another address and fires the Transfer event. function transferFrom public returns ///approves an address to withdraw from your account multiple times, up to the maximum _value amount ///specified. function approve public returns ///returns the remaining amount to which an address can still withdraw from your account. function allowance public view returns ///triggered when tokens are transferred, including zero value transfers. event Transfer ///triggered on any successful call to approve method. event ApprovalThis standard defines methods and events that should be implemented on a smart contract. A contract implementing these standards is called an ERC-721 Non-Fungible Token Contract. It will create, monitor and perform operations on the token on the Ethereum protocol.which must be globally unique. This standard specifies the following methods: ///Count all NFTs assigned to the owner`s address. function balanceOf external view returns ; ///returns the owner`s address of an NFT. function ownerOf external view returns ; ///transfers the ownership of an NFT from one address to another address function safeTransferFrom external payable; ///transfers the ownership of an NFT from one address to another address ///This works identically to the other function with an extra data parameter, /// except this function just sets data to "". function safeTransferFrom external payable; ///Transfer ownership of an NFT function transferFrom external payable; ///Change or reaffirm the approved address for an NFT function approve external payable; ///Enable or disable approval for a third party address to manage an NFT. function setApprovalForAll external; ///Get the approved address for the specified NFT. function getApproved external view returns ; ///Query if an address is an authorized operator for another address. ///True if `_operator` is an approved operator for `_owner`, false otherwise. function isApprovedForAll external view returns ;///Triggered when ownership of NFT changes by any mechanism. event Transfer; ///Triggered when the approved address for any NFT is changed or reaffirmed. event Approval; ///Triggered when an operator address is enabled or disabled for an owner. event ApprovalForAll;It is a Fungible token standard which improves the existing ERC-20 token standard. The ERC-777 provides the following improvements over ERC-20:It is a function described on the smart contract and gets called when tokens are sent or received through the contract. It allows smart contracts to react to incoming or outgoing tokens. The hook can perform the following operations:Hooks allow sending tokens to a contract and notifying the contract in a single transaction, unlike ERC-20 which requires a double call to achieve this.The ERC-777 standard **adds ** the following methods to an ERC-20 contract: /// returns the granularity which may be minted, sent or burned at any time. function granularity external view returns ///returns the list of default operators as defined by the token contract. function defaultOperators external view returns ///sets a third party address as an operator of to send and burn tokens on its behalf. function authorizeOperator external ///removes the right of the operator address to send and burn tokens. function revokeOperator external ///Indicates whether the operator address is an operator of the holder address. function isOperatorFor external view returns ///Send the amount of tokens from the address msg.sender to the address to. function send external ///Sends the amount of tokens on behalf of the address. function operatorSend external ///Burn the amount of tokens from the address . function burn external ///Burn the amount of tokens on behalf of the address from. function operatorBurn external///Indicates the authorization of operator as an operator for holder. event AuthorizedOperator ///Indicates the revocation of operator as an operator for holder. event RevokedOperator ///Indicates a send of amount of tokens by the operator address. event Sent ///Indicate the minting of amount of tokens to an address by the operator address. event Minted ///Indicate the burning of amount of tokens from an address by the operator address. event Burned///Notify a request to send or burn an amount tokens from an address to another address by the ///operator address. function tokensToSend external ///Notify a receival of tokens from an address by the operator address. function tokensReceived externalIt is a standard interface for contracts that manage multiple token types. May include combinations of fungible tokens, non-fungible tokens or other configurations. . The ERC-1155 token can do the same functions as an ERC-20 and ERC-721 token, and even both at the same time while improving efficiency.///similar to regular ERC-20 transferFrom but passes arrays for ///_values and _ids function safeBatchTransferFrom external; ///we can retrieve multiple balances in a single call by passing arrays in ///_owners and _ids function balanceOfBatch external view returns ; ///Explicitly approve an address to operate on any amount of tokens function setApprovalForAll external; ///Check if an address is approved to operate on any amount of tokens function isApprovedForAll external view returns ; The standard also implements receive **hooks ** for smart contracts which must return a magic predefined bytes4 value. When the receiving contract returns this value, it is assumed the contract accepts the transfer and knows how to handle the ERC-1155 tokens thus no more stuck tokens in a contract.which include: In ERC-1155 we only have transferFrom, no transfer. To use it as a regular transfer, just set the from address to the address that's calling the function The caller must be approved to spend the tokens for the _from address or the caller must equal _from.length of _ids is not the same as length of _values. any of the balance of the holder for token in _ids is lower than the respective amount in _values sent to the recipient.Welcome To The Web3 Writing Contest This standard allows developers to build token applications that are interoperable with other products and services.It is a standard interface for Non-Fungible Tokens which may include artwork or songs. Used to identify something or someone uniquely.Allows developers to build extra functionality on top of tokens for improved transactions privacy or emergency recovery options.A Deep Dive Into the standards Now with a brief introduction to the types of tokens on the Ethereum protocol, let’s do a deep dive into each of them and look at their nitty-gritty details. Note: These are not the actual details on how to create the token but an explanation on the engineering used to create the token. Things only get interesting onwards😀.This standard defines methods and events that should be implemented on a smart contract. A contract implementing these standards is called an ERC-20 Token Contract. It will create, monitor and perform operations on the token on the Ethereum protocol. This standard specifies the following methods: ///returns the name of the token which may or may not be present. function name public view returns ///returns the symbol of the token which also may or may not be present. function symbol public view returns ///returns the number of decimals which determines the lowest possible unit the token can accept. ///[Wei - Eth] function decimals public view returns ///returns the total token supply defined during creation. function totalSupply public view returns ///returns the number of tokens a given address has. function balanceOf public view returns ///transfers _value amount of tokens to address _to, and fires the Transfer event. function transfer public returns ///transfers _value amount of tokens from an address to another address and fires the Transfer event. function transferFrom public returns ///approves an address to withdraw from your account multiple times, up to the maximum _value amount ///specified. function approve public returns ///returns the remaining amount to which an address can still withdraw from your account. function allowance public view returns ///triggered when tokens are transferred, including zero value transfers. event Transfer ///triggered on any successful call to approve method. event ApprovalThis standard defines methods and events that should be implemented on a smart contract. A contract implementing these standards is called an ERC-721 Non-Fungible Token Contract. It will create, monitor and perform operations on the token on the Ethereum protocol.which must be globally unique. This standard specifies the following methods: ///Count all NFTs assigned to the owner`s address. function balanceOf external view returns ; ///returns the owner`s address of an NFT. function ownerOf external view returns ; ///transfers the ownership of an NFT from one address to another address function safeTransferFrom external payable; ///transfers the ownership of an NFT from one address to another address ///This works identically to the other function with an extra data parameter, /// except this function just sets data to "". function safeTransferFrom external payable; ///Transfer ownership of an NFT function transferFrom external payable; ///Change or reaffirm the approved address for an NFT function approve external payable; ///Enable or disable approval for a third party address to manage an NFT. function setApprovalForAll external; ///Get the approved address for the specified NFT. function getApproved external view returns ; ///Query if an address is an authorized operator for another address. ///True if `_operator` is an approved operator for `_owner`, false otherwise. function isApprovedForAll external view returns ;///Triggered when ownership of NFT changes by any mechanism. event Transfer; ///Triggered when the approved address for any NFT is changed or reaffirmed. event Approval; ///Triggered when an operator address is enabled or disabled for an owner. event ApprovalForAll;It is a Fungible token standard which improves the existing ERC-20 token standard. The ERC-777 provides the following improvements over ERC-20:It is a function described on the smart contract and gets called when tokens are sent or received through the contract. It allows smart contracts to react to incoming or outgoing tokens. The hook can perform the following operations:Hooks allow sending tokens to a contract and notifying the contract in a single transaction, unlike ERC-20 which requires a double call to achieve this.The ERC-777 standard **adds ** the following methods to an ERC-20 contract: /// returns the granularity which may be minted, sent or burned at any time. function granularity external view returns ///returns the list of default operators as defined by the token contract. function defaultOperators external view returns ///sets a third party address as an operator of to send and burn tokens on its behalf. function authorizeOperator external ///removes the right of the operator address to send and burn tokens. function revokeOperator external ///Indicates whether the operator address is an operator of the holder address. function isOperatorFor external view returns ///Send the amount of tokens from the address msg.sender to the address to. function send external ///Sends the amount of tokens on behalf of the address. function operatorSend external ///Burn the amount of tokens from the address . function burn external ///Burn the amount of tokens on behalf of the address from. function operatorBurn external///Indicates the authorization of operator as an operator for holder. event AuthorizedOperator ///Indicates the revocation of operator as an operator for holder. event RevokedOperator ///Indicates a send of amount of tokens by the operator address. event Sent ///Indicate the minting of amount of tokens to an address by the operator address. event Minted ///Indicate the burning of amount of tokens from an address by the operator address. event Burned///Notify a request to send or burn an amount tokens from an address to another address by the ///operator address. function tokensToSend external ///Notify a receival of tokens from an address by the operator address. function tokensReceived externalIt is a standard interface for contracts that manage multiple token types. May include combinations of fungible tokens, non-fungible tokens or other configurations. . The ERC-1155 token can do the same functions as an ERC-20 and ERC-721 token, and even both at the same time while improving efficiency.///similar to regular ERC-20 transferFrom but passes arrays for ///_values and _ids function safeBatchTransferFrom external; ///we can retrieve multiple balances in a single call by passing arrays in ///_owners and _ids function balanceOfBatch external view returns ; ///Explicitly approve an address to operate on any amount of tokens function setApprovalForAll external; ///Check if an address is approved to operate on any amount of tokens function isApprovedForAll external view returns ; The standard also implements receive **hooks ** for smart contracts which must return a magic predefined bytes4 value. When the receiving contract returns this value, it is assumed the contract accepts the transfer and knows how to handle the ERC-1155 tokens thus no more stuck tokens in a contract.which include: In ERC-1155 we only have transferFrom, no transfer. To use it as a regular transfer, just set the from address to the address that's calling the function The caller must be approved to spend the tokens for the _from address or the caller must equal _from.length of _ids is not the same as length of _values. any of the balance of the holder for token in _ids is lower than the respective amount in _values sent to the recipient.

We have summarized this news so that you can read it quickly. If you are interested in the news, you can read the full text here. Read more:

hackernoon /  🏆 532. in US

 

United States Latest News, United States Headlines

Similar News:You can also read news stories similar to this one that we have collected from other news sources.

10 Important Projects And Tokens On The Ethereum Ecosystem | Binance Blog10 Important Projects And Tokens On The Ethereum Ecosystem | Binance BlogThe Ethereum ecosystem is home to an array of different projects packing strong utility. Find out how you can access some of the top projects and tokens within the Ethereum ecosystem on Binance.
Read more »

Adventures of Huckleberry Finn: Chapter IX | HackerNoonAdventures of Huckleberry Finn, by Mark Twain (Samuel Clemens) is part of HackerNoon’s Book Blog Post series.
Read more »

Moby-Dick; or The Whale: Chapter 15 - Chowder | HackerNoonMoby-Dick; or The Whale: Chapter 15 - Chowder | HackerNoonMoby-Dick; or The Whale, Chapter 15: Chowder by Herman Melville is part of HackerNoon’s Book Blog Post series.
Read more »

Tether Launches Tokens Pegged to the Mexican Peso on Ethereum, Tron, and Polygon – Altcoins Bitcoin NewsTether Launches Tokens Pegged to the Mexican Peso on Ethereum, Tron, and Polygon – Altcoins Bitcoin NewsThe stablecoin issuer Tether has announced the company has launched a new fiat-pegged token tied to the value of the Mexican peso.
Read more »

Tether launches stablecoin pegged to pesos on Ethereum, Tron and PolygonTether launches stablecoin pegged to pesos on Ethereum, Tron and PolygonTether is heading south of the border. It launches a new digital asset that will be pegged to the Mexican peso on Ethereum, Tron and Polygon networks. (Reporting via ezrareguerra)
Read more »

Pride and Prejudice: Chapter 7 | HackerNoonPride and Prejudice: Chapter 7 | HackerNoonPride and Prejudice, by Jane Austen, is part of HackerNoon’s Book Blog Post series.
Read more »



Render Time: 2026-04-12 15:39:46