What is the ERC-777 token?
Like the ERC-223, the ERC-777 is designed to improve the ERC-20 token standard. One of the best aspects of the ERC-777 compared to the ERC-20 is that, like the ERC-223, it eliminates the shortcomings that lead to the loss of tokens.
The ERC-777 standard is unique in the breadth of transaction processing mechanisms. To explain the ERC-777, you need to understand the concept of the standard ERC-820. In this standard, a central registry of smart contracts was created on the network. The record allows anyone to “verify” the address of a smart contract and check the functions it supports. The ERC-777 uses the same central register of the ERC-820 to simplify the verification of the functions of smart contracts. It also creates an entirely new set of features instead of using “send” and “approval,” which are used in the ERC-20 standard. The ERC-777 uses the "send" function to transmit the ETH itself. Another essential point that concerns ERC-777 is that it allows people to approve smart contracts and transfer tokens on their behalf. This makes the ERC-777 easily customizable because it will allow people to create additional functions on top of tokens, for example, contracts to improve the confidentiality of transactions or for disaster recovery in case of loss of a private key. Besides, the ERC-777 creates a standard for burning tokens, which can be very useful depending on the specific project economy that is passed.
What are the main advantages of the ERC-777 token?
- ERC-777 uses the same central register of the ERC-820, which makes it easier to verify the functions of an intelligent contract.
- ERC-777 significantly reduces the time spent on can be performed in one transaction, and not divided into two transactions, as in the past, so the cost of converting tokens is much lower.
- ERC-777 will support the sending of transaction data, which was not possible with digital tokens that previously used the ERC-20 standard. This means that the new token standard uses the smart contract feature to create tokens with customizable capacity.
- ERC-777 reduce the potential amount of cryptocurrency loss. A cryptocurrency address compatible with the new token standard ERC777 (and ERC820) may reject certain transactions of digital tokens, for example, the user can reject some addresses from the blacklist, which to some extent increases the security of the blockchain.
What are the main disadvantages of the ERC-777 token?
- There are currently no known applications based on the ERC-777 token standard, so it is not understood whether this standard will be widely applied in the future. Considering that it is more subject to customization than ERC-20, almost every application on ERC-20 can benefit from future migration to ERC-777.
- It relies on centralized registration of smart contracts. This is not an ideal method in the decentralized ideology of blockchains. This will require Ethereum developers to take additional measures to ensure the security of their registry.
- Sets decimals to default 18. This is a controversial step: many people find it a mistake to add custom decimals in ERC20. The idea is that for an ecosystem it is not very useful to add lower thresholds for the divisibility of your token (and it makes no sense to add more than 18), as well as add your decimal numbers, which makes it challenging to write stand-alone wallets such as Trezor.
Comparison of ERC-777 and other standards
The ERC-721 standard contains similar functions of the ERC-20 token so that the purses display simple and relevant information about each token. Its goal is to allow a smart contract to have a popular cryptocurrency, such as Bitcoin or Ethereum, allowing users to perform actions such as sending tokens and checking account balances.
|Function ||ERC-721 ||ERC-20 ||ERC-827 ||ERC-223 ||ERC-777 ||ERC-1155 |
|name||yes||yes||yes ||yes ||yes ||yes |
|yes ||yes ||yes ||yes |
|transferSingle ||no ||no ||no ||no ||no ||yes |
|transferBatch ||no ||no ||no ||no ||no ||yes |
|yes ||yes ||no ||no |
|granuality ||no ||no ||no ||no ||yes ||no |
|yes ||yes ||yes ||no |
|balanceOf ||yes |
|yes ||yes ||yes ||yes |
|URI ||no ||no ||no ||no ||no ||yes |
|send ||no ||no ||no ||no ||yes ||no |
|authorizeOperator ||no ||no ||no ||no ||yes ||no |
|revokeOperator ||no ||no ||no ||no ||yes ||no |
|isOperatorFor ||no ||no ||no ||no ||yes ||no |
|operatorSend ||no ||no ||no ||no ||yes ||no |
|transfer ||yes |
|yes ||yes ||no ||no |
|transferFrom ||yes |
|yes ||no ||no ||no |
|safeTransferFrom ||no ||no ||no ||no ||no ||yes |
|safeBatchTransferFrom ||no ||no ||no ||no ||no ||yes |
|balanceOfBatch ||no ||no ||no ||no ||no ||yes |
|isApprovedForAll ||no ||no ||no ||no ||no ||yes |
|setApprovalForAll ||no ||no ||no ||no ||no ||yes |
|approve ||yes |
|yes ||no ||no ||no |
|approvalForAll ||no ||no ||no ||no ||no ||yes |
|allowance ||yes |
|yes ||no ||no ||no |
|approveAndCall ||no ||no ||yes ||no ||no ||no |
|transferFromAndCall ||no ||no ||yes ||no ||no ||no |
|transferAndCall ||no ||no ||yes ||no ||no ||no |
|transfer(address, uint) ||no ||no ||no ||yes ||no ||no |
|transfer(address, uint, bytes) ||no ||no ||no ||yes ||no ||no |
|tokenFallback ||no ||no ||no ||yes ||no ||no |
- name — Used to specify token contracts and external applications;
- granularity — Returns the indivisible part of the token.
- symbol — Helps ensure its compatibility with the ERC20 standard and provides external programs with its short name;
- totalSupply — This function indicates the total number of tokens in the blockchain;
- balanceOf — Using this function you can find the number of tokens that have an established address
- send — Sending tokens to the address.
- authorizeOperator — A third party authorization to send tokens on its own behalf.
- revokeOperator — Cancellation of the right of third parties to send tokens.
- isOperatorFor — Availability check. Is it allowed to send tokens to the final address?
- operatorSend — Sending tokens from one address to another.
- transferAndCall — A function that allows you to transfer tokens by address. Must initiate function transfer.
- transferFromAndCall — The method is used for the withdrawal process, allowing contracts to transfer tokens on your behalf before performing the function
- approveAndCall — allows you to withdraw funds from the account several times, up to a certain amount
- TransferSingle — Makes it possible to transfer a token to other participants
- TransferBatch — must issue tokens during transfer, including transfer with zero value, as well as chasing or burning.
- tokenFallback — Functions for handling the transfer token.
- URI — Transfers values from one address to another.
- safeTransferFrom — Sending multiple types of tokens from the third party in one transfer
- safeBatchTransferFrom — Get account balance tokens.
- transfer ( address , uint , bytes ) — A function that is always called when someone wants to transfer tokens.
- ApprovalForAll — Get a balance of multiple account / token pairs
- balanceOfBatch — Enable or disable approval for a third party (“operator”) to control all caller tokens.
- isApprovedForAll — Caller must be approved.
- setApprovalForAll — Requests the operator confirmation status for the owner
- transferFrom — Transfers the number of tokens from one address to another.
- takeOwnership — This method is a withdrawal function that can be used when the user has received a certain number of tokens and wants to remove them from the balance of another user. It indicates which account currently belongs to the token and which another account can take possession in the future;
- approve — Allows the sender to withdraw amounts from his account several times. That is, is a confirmation.
- allowance — Returns the number from which the sender is still allowed to withdraw money.
- transfer ( address , uint ) — Required for backward compatibility reasons.
This EIP does not use transfer and transferFrom ; instead, it uses send and operatorSend to avoid errors. This approach can ensure that the functions of this standard will not overlap and redefine with the functions of any other token standard, so you can create a token that is compatible with the ERC777 and ERC820 standards at the same time. ERC777 implements the authoriseOperator function, which allows a third party to manage the platform on your behalf. The developer explained that this method is considered obsolete and that it should not be used. In addition, authorizing someone to manage tokens from a third party impairs network bandwidth and requires more gas.
Backward compatibility of ERC-777 and ERC-20
The following statement can be found in the GitHub repository of the ERC777 project: "This EIP is compatible with the old standard of tokens ERC-20."
However, there is an alternative opinion: Wallets and services such as MetaMask, Mist and MyEtherWallet work with ERC20 tokens. The input intended for the ERC20 token contains the encoded parameters and the signature of the function. The function calls the Ethereum virtual machine are determined by the first four bytes of data sent with the transaction. These 4-byte signatures are defined as the first four bytes of the hash of the canonical representation of the function signature. This means that the transfer (address, uint256) and send (address, uint256) functions will have different signatures. As a result, the input designed for the ERC20 token will not be valid for the ERC777 token. Consequently, if the token implements ERC-20, it must be registered through the ERC-20Token interface via ERC820.