What Is ERC-777 Token Standard & Why It Matters
![erc 777](https://cdn.sanity.io/images/zu5719jl/production/12eb48aa661fe58a302cf8c2ad83ef072ea065c8-1920x1080.png?rect=1,0,1918,1080&w=728&h=410&fm=webp)
ethereum
If you’re a crypto enthusiast, chances are that you’re familiar with ERC-20. But what could ERC-777 be? Is it yet another Ethereum standard or protocol for something?
The answer is no—it has nothing to do with the seventh son of the seventh son of the seventh son, nor anything of the sort. But yes, it has to do with the aforementioned ERC-20—in fact, the two are closely related, even more than you may think.
ERC-777 represents the latest upgrade of the ERC-20, the most widespread token standard. For now, this might not mean a thing to you. However, if you ever get an idea to develop a crypto project, the similarities and differences between the two will be of immense significance.
But without much ado, let’s see what ERC-777 is and why it is so important.
What Is ERC-777 Token Standard?
ERC-777 refers to a fungible token standard introduced on the Ethereum blockchain. It was developed from the already widespread ERC-20 standard in order to allow for engaging with a token contract in a new way while remaining backward compatible.
This novel token standard does not only help generate new fungible tokens on the network. It also simplifies complex token trade interactions and helps remove ambiguity around minting and burning, as well as decimals. To achieve this, it implements a unique feature dubbed a hook.
![What Is ERC-777](https://cdn.sanity.io/images/zu5719jl/production/e4592386985c43a76c8b1937c5556c28af55008b-1600x900.jpg?fm=webp)
ERC-777 hooks let smart contracts, operators, and addresses know about incoming transactions and thus enable them to control or reject which tokens they receive or send. There are two hooks—tokensReceivedand tokensToSend. The receiving account implements the former, whereas the sending account employs the latter.
By setting up hooks to accept or decline specific tokens, recipients can reduce the incidence of receiving incompatible token types, which, in case they happen, may result in the loss of tokens.
ERC-777 token standard functions in the same way as Ether. First, users send tokens by implementing the 'send' option. Next, when the tokens are received, the ‘receive’ code is triggered. In this very case, the difference between the two aforementioned standards comes to light.
In the case of ERC-20, tokens drift from one smart contract to the next, with only the issuer making changes within the smart contract. When it comes to ERC-777, however, such a call can’t be made more than once.
Namely, this token standard takes advantage of the new ERC-820, which allows for the registration of contract metadata for fundamental introspection. This further enables backward and forward compatibility, along with adding new features.
8 Advantages of ERC-777 Token Standards
In addition to implementing hooks, which is the key distinctive feature of the ERC-777, these tokens are backward compatible with ERC-20. This implies that, in the ERC-777 vs. ERC-20 battle, the latter would be rendered obsolete. Instead, ERC-777 tokens interact with the ones created on the ERC-20 since both implement identical functionality.
However, these are not the sole advantages of this token standard. Here are some others:
- It implements the send (dest, value, data) philosophy to send tokens (just like Ether).
- A tokenReceived hook can be determined in any contract and regular address so that it’s triggered once the tokens are received. This way, the double call required in ERC-20 can be avoided.
- Registering a tokensToSend function allows smart contracts and addresses to control and eventually reject tokensthey send.
- In the same way, registering a tokenReceived function enables contracts and addresses to control and decline tokens they receive.
- Token holders have the option to authorize and revoke operators who manage their tokens. Those can be verified contracts like exchanges, check processors, or automatic charging systems.
- All token transactions include userData bytes field and, in case of an operator transaction, operatorData. Both the sender and operator can employ them without restrictions to send data to the recipient.
- ERC-777 token standard can be implemented in a backward-compatible way with wallets that don’t have the tokensReceived function.
ERC-777 Backward Compatibility
As already mentioned, backward compatibility implies that ERC-777 tokens can interact with those of ERC-20 without any frictions or limitations. This further allows for employing ERC-777 tokens whenever ERC-20 is accepted.
Thus, the ERC-777 standard ensures that the existing ERC-20 won’t be disrupted. Hence, a token contract can employ both standards in parallel. Yet, though some functions may overlap seamlessly, ERC-777 has some extra rules and functions that must be followed.
State-modifying functions from both ERC-777 and ERC-20 are decoupled, and as such, they can operate independently. However, ERC-20 functions should be restricted to calls from old contracts only.
![Ethereum blockchain](https://cdn.sanity.io/images/zu5719jl/production/9ef6c01a8ff335be1bf3c5324f12e25476f05a48-1600x1066.jpg?fm=webp)
The distinction for new contracts that implement the ERC-20 standard is that the new hooks (tokensToSend and tokensReceived) are superior to ERC-20. When the token receives transfer and transferFrom call, the contract has to check whether the address implements the hooks. If either of the hooks is implemented, it has to be called.
In case the transfer option on the ERC-20 contract is called, and the tokenReceived is not employed, then the transfer call needs to be accepted, despite the fact it might be locked.
If the tokenToSend hook is not employed, no specific action will be taken. However, the movement can only be canceled if a condition is not met (an absence of funds, for instance).
The Role of EIP in Validating ERCs
EIP, or Ethereum Improvement Protocol, represents a formal system for proposing new upgrades, features, and changes to the Ethereum blockchain network.
It could be depicted as a town hall for the entire Ethereum community, where any member has an opportunity to create an EIP elaborating on specs for the suggested modifications. Thus, an EIP can be regarded as a sort of bulletin for Ethereum researchers and developers, as well as ordinary users, to review and discuss, then collectively decide on prospective processes.
There are three major types of an EIP: Standards Track, Meta, and Informational. Each of the types has its own subtypes, one of which is Ethereum Request for Comment, also known as ERC.
ERC represents a protocol for suggesting and standardizing new smart contract and token standards on the Ethereum network. They are quite similar to EIPs in terms of proposing changes and upgrades to the ecosystem. Yet, there are a couple of striking differences.
Unlike EIPs, ERCs focus exclusively on determining new smart contract and token standards. In contrast to EIPs, ERCs do not require unanimous approval from all participants on the network.
ERC standards generate rules and specifications for new tokens or smart contracts to be employed on the Ethereum platform. Those typically include the name and symbol of the fungible or non-fungible token, decimals, and total supply. It’s usually developers who propose ERCs, but any member of the community can do it as well.
Ethereum Request for Comment is of profound significance, as it offers a standardized way for designing new smart contracts and tokens on the blockchain. This further allows for smoother integration and accessibility of these new projects with other Ethereum-based applications.
ERC-777 Potential Risks and Challenges
ERC-777 brings new and enhanced features to the table, which enable tokens to be more responsive when interacting. However, this standard doesn’t come without certain risks and challenges.
![ERC-777 Token](https://cdn.sanity.io/images/zu5719jl/production/dbecc1baa1e22829f4aaee3eea4efee2e183d1ab-1600x1067.jpg?fm=webp)
Namely, the ERC-777 standard can be prone to various kinds of attacks. For this reason, numerous developers propose using the ERC-20 standard instead. The key problem seems to be vulnerability to DOS (Denial-of-Service) attacks on smart contracts, mainly due to the hooks and callbacks.
It has already been mentioned that the hooks are at the heart of the ERC-777 upgrades. They let external smart contracts meddle with token transfers before or after they take place. This, however, can be a two-edged sword, as it opens the door to malicious actions.
Here are some potential scenarios of how ERC-777 tokens can be abused for DOS attacks.
- Malicious token recipient—an external user executes a DOS attack and diverts tokens from a smart contract.
- Token distribution—ERC-777 tokens are distributed among several users.
- Callback reversion—the malicious actor programs a smart contract to revert the transaction, thus preventing further execution of the smart contract.
- Gas consumption—reverting a transaction uses up gas. As Ethereum implements gas fees, this may lead to wasting precious resources, further affecting the efficiency of the network.
To mitigate vulnerabilities, it’s necessary to perform audits and security checks. If needed, developers may include locks to hinder multiple entrances during a single transaction. Last but not least, it’s advisable to always check whether the final balance agrees with the expected balance.
How to Acquire ERC-777 Tokens
![Ethereum wallet](https://cdn.sanity.io/images/zu5719jl/production/345073d3a6f0a8f86ad9c7ded33c8e7f80d44bc8-1600x1015.jpg?fm=webp)
As previously mentioned, ERC-777 is a standard for creating fungible tokens on the Ethereum network. Hence, some of the ERC-777 examples include but are not limited to Bancor (BNT), MakerDAO (MKR), and Loopring (LRC).
These tokens can be acquired in several ways, just like tokens of any other standard:
- Centralized and decentralized exchanges. Multiple DEXs and CEXs support these tokens and have included them in their lists of tradable assets. DEXs offer greater anonymity as they are based on P2P trading. CEXs, on the other hand, may offer higher liquidity but require you to create an account and submit proof of identity.
- Airdrops. Keeping an eye on (new) blockchain projects and token distribution events may get you new tokens. Some projects airdrop tokens to early supporters or holders of specific tokens for free.
- ICOs and token sales. Initial coin offerings and token sales are a perfect opportunity to raise capital by investing small amounts of money. Taking part in these events may get you ERC-777 tokens at an early stage.
- Peer-to-peer transactions. Last but not least, peer-to-peer (P2P) transactions could be a handy way to get new tokens. You only need to find sellers within your network and set up a wallet, and you’re all ready to purchase your ERC-777 tokens.
Keep in mind that, in order to obtain an ERC-777 token, you need to have a compatible Ethereum wallet,such as MetaMask, to store and manage your tokens. Moreover, always do your due diligence and research assets thoroughly—it will spare you from wasting both time and money.
Key Takeaways
The ERC-777 standard for fungible tokens stands out from other ERC standards thanks to allowing for more complicated interactions when trading tokens. Being an extension of ERC-20, ERC-777 is backward compatible with it, i.e., can interact with it rather than pushing it away and making it obsolete.
This token standard is prominent for its ‘send’ and ‘receive’ hooks, which give users more control over token transactions. It’s precisely those hooks that distinguish ERC-777 from other token standards and make it an upgrade of ERC-20.
Just like all fungible and non-fungible token standards, ERC-777 comes with its own advantages and challenges. The key benefits would be the hooks and backward compatibility, which enable numerous functionalities. However, this standard is vulnerable to DOS attacks, which can be prevented with careful audits and security checks.