TOKEN ERC: most common standards and implementation
ERC-20 Token
Currently, although its functionality is basic, it is the most widely used and most relevant standard due to its great interoperability in the environment.
Provide the methods of token transfer (transfer), approval or authorization of use of your tokens to another Ethereum address (profit), authorized token transfer from another Ethereum address (transferFrom), current balance query (balanceOf), and query of the number of tokens possible to use on behalf of another Ethereum address (allowance). In addition, there are two types of events (Transfer and Approval) that are triggered when a transfer or approval is made.
To characterize the token, a value must be assigned to a series of attributes in the form of a variable. The only mandatory parameter is the number of total available tokens (totalSupply), the others such as the name (name), the symbol (sym), and the number of decimals (decimals) are optional, although important if you want to give more detail to your token and distinguish it from others. The number of decimal places offers the ability to subdivide a token unit into 18 decimal places.
But, where is the balance of each user who owns that token kept? Good question. To save the balances, a 'mapping' type variable is used, which relates an Ethereum address with its corresponding token balance: (mapping (Address => uint256) balances)
In the 'Etherscan' explorer you can check the number of existing tokens deployed in the main Ethereum network, as well as their value and more information. At the time of writing this article, there were 125,699 ERC20 tokens. Probably when you look back at this number it has grown quite a bit, as new ones are being deployed every day.
ERC-721 Token
The ERC721 is the standard of NOT fungible token par excellence (called NFT, Non-Fungible Tokens). The concept of "NO fungibility" comes to say that it is unique and cannot be replaced by another. Another characteristic resulting from the above is its indivisibility, since it remains as a singular unit, unlike the ERC20. It is therefore a non-consumable token, but it is exchangeable. It can represent anything from ownership of a work of art to a loan or a traffic ticket. An example of a non-fungible token could be the owner of a house since it is something unique and indivisible that when you transfer it to another person it becomes part of their property and you would stop owning it. An example of a fungible token would be money, where a monetary unit (for example, a € 1 coin) is equal and has the same value as another monetary unit (another € 1 coin)
Other possible implementations to carry out can be to reject transfers if the contract is paused, create a list of safe or authorized addresses, reject non-secure transfers, charge the cost of the transaction to both parties, etc.
At the moment, its use is inferior to the ERC20, although it must be recognized that its future is very promising. In the 'Etherscan' explorer it can be seen that there are 262 ERC721 tokens deployed on the Ethereum mainnet.
Token ERC-777 - New Advanced Token Standard
It is an improvement of the ERC20 that incorporates more advanced functionalities such as:
• Implement a send function: send (to, amount, data), instead of the usual transfer function: transfer (to, amount).
• It allows to control and reject tokens sent/received by registering “hook” functions: tokensToSend (operator, from, to, amount, data, operator data), tokens received (operator, from, to, amount, data, operator data). It is useful, for example, to give the sender or recipient the option to intervene in the transfer and even reject it.
Development of ERC20 that incorporates an exchange service facilitating cross payments of tokens. It allows the holder of an ERC20 token to exchange it with another ERC20 using an exchange token to make the transfers: exchange token (target contract, amount). It implements variables of type “mapping” to relate: address and amount of the exchanged token (exchanged with); address of the person initiating the exchange and the amount (exchanged); and the number of tokens received and the address of the person who issued it (exchanges received).
For ethereum token development contact us
https://www.blockchainx.tech/erc20-token-development
TOKEN ERC: most common standards and implementation
ERC-20 Token
Currently, although its functionality is basic, it is the most widely used and most relevant standard due to its great interoperability in the environment.
Provide the methods of token transfer (transfer), approval or authorization of use of your tokens to another Ethereum address (profit), authorized token transfer from another Ethereum address (transferFrom), current balance query (balanceOf), and query of the number of tokens possible to use on behalf of another Ethereum address (allowance). In addition, there are two types of events (Transfer and Approval) that are triggered when a transfer or approval is made.
To characterize the token, a value must be assigned to a series of attributes in the form of a variable. The only mandatory parameter is the number of total available tokens (totalSupply), the others such as the name (name), the symbol (sym), and the number of decimals (decimals) are optional, although important if you want to give more detail to your token and distinguish it from others. The number of decimal places offers the ability to subdivide a token unit into 18 decimal places.
But, where is the balance of each user who owns that token kept? Good question. To save the balances, a 'mapping' type variable is used, which relates an Ethereum address with its corresponding token balance: (mapping (Address => uint256) balances)
In the 'Etherscan' explorer you can check the number of existing tokens deployed in the main Ethereum network, as well as their value and more information. At the time of writing this article, there were 125,699 ERC20 tokens. Probably when you look back at this number it has grown quite a bit, as new ones are being deployed every day.
ERC-721 Token
The ERC721 is the standard of NOT fungible token par excellence (called NFT, Non-Fungible Tokens). The concept of "NO fungibility" comes to say that it is unique and cannot be replaced by another. Another characteristic resulting from the above is its indivisibility, since it remains as a singular unit, unlike the ERC20. It is therefore a non-consumable token, but it is exchangeable. It can represent anything from ownership of a work of art to a loan or a traffic ticket. An example of a non-fungible token could be the owner of a house since it is something unique and indivisible that when you transfer it to another person it becomes part of their property and you would stop owning it. An example of a fungible token would be money, where a monetary unit (for example, a € 1 coin) is equal and has the same value as another monetary unit (another € 1 coin)
Other possible implementations to carry out can be to reject transfers if the contract is paused, create a list of safe or authorized addresses, reject non-secure transfers, charge the cost of the transaction to both parties, etc.
At the moment, its use is inferior to the ERC20, although it must be recognized that its future is very promising. In the 'Etherscan' explorer it can be seen that there are 262 ERC721 tokens deployed on the Ethereum mainnet.
Token ERC-777 - New Advanced Token Standard
It is an improvement of the ERC20 that incorporates more advanced functionalities such as:
• Implement a send function: send (to, amount, data), instead of the usual transfer function: transfer (to, amount).
• It allows to control and reject tokens sent/received by registering “hook” functions: tokensToSend (operator, from, to, amount, data, operator data), tokens received (operator, from, to, amount, data, operator data). It is useful, for example, to give the sender or recipient the option to intervene in the transfer and even reject it.
Development of ERC20 that incorporates an exchange service facilitating cross payments of tokens. It allows the holder of an ERC20 token to exchange it with another ERC20 using an exchange token to make the transfers: exchange token (target contract, amount). It implements variables of type “mapping” to relate: address and amount of the exchanged token (exchanged with); address of the person initiating the exchange and the amount (exchanged); and the number of tokens received and the address of the person who issued it (exchanges received).
For ethereum token development contact us
https://www.blockchainx.tech/erc20-token-development
0 Comments
0 Shares