ERC-777
Last Updated: November 19, 2026
ERC-777 is an Ethereum token standard for fungible tokens that adds hooks and operators on top of the ideas in ERC-20. Its hooks let senders and receivers run code when tokens move. The standard is final, but it is rarely chosen today, because those same hooks created serious risks for smart contracts that were not built for them.
Origin and Status
ERC-777 began as Ethereum Improvement Proposal 777, created on November 20, 2017, by Jacques Dafflon, Jordi Baylina and Thomas Shababi. The official EIP-777 page lists it as Final. It requires ERC-1820, a registry contract where addresses declare which hook functions they use. Our ERC entry explains how standards reach Final.
Features of ERC-777
- Operators: a holder can authorize a third party, called an operator, to send tokens on its behalf, such as a custodial service or a payment processor.
- Token hooks: before tokens leave an address, ERC-777 calls a tokensToSend hook registered by the holder. After tokens arrive, it calls a tokensReceived hook registered by the recipient. Either side can reject the move by reverting.
- Compatibility: an ERC-777 token can also expose the ERC-20 functions, so wallets and exchanges that only understand ERC-20 can still hold and move it.
The Reentrancy Problem
Hooks hand control to outside code in the middle of a transfer. A contract that sends tokens before updating its own records can be called again before those records are correct. This is reentrancy, the same class of flaw behind The DAO hack in 2016. Many DeFi contracts written for plain ERC-20 tokens did not expect a token to call back into them.
Real Attacks in 2020
On April 18, 2020, an attacker used imBTC, an ERC-777 token, to drain the ETH and imBTC pool on Uniswap v1 through the tokensToSend hook, according to imToken, which issued imBTC. On April 19, a similar attack on the Lendf.Me lending protocol took about $25 million in user assets. Lendf.Me later recovered almost the full amount.
imToken said at the time that there was nothing fundamentally wrong with using ERC-777 and that imBTC had been audited. The lesson was about integration: any contract that accepts tokens should update its records before making external calls and add reentrancy guards, as covered in our blockchain security guide.
Why ERC-20 Still Dominates
ERC-20 is simpler, older and supported by nearly every wallet, exchange and DeFi protocol. ERC-777’s extra power brought extra risk, and lighter ways to get similar features appeared, such as permit signatures under ERC-2612. OpenZeppelin, whose contract library many projects build on, removed its ERC-777 code in OpenZeppelin Contracts 5.0, announced on October 5, 2023.
Limits and Risks
The main danger is less the token itself than how other contracts handle it. Decentralized finance (DeFi) protocols that accept any token can face callbacks they never planned for. ERC-777 also depends on the ERC-1820 registry, which adds another moving part, and support in wallets and developer tools is thinner than for ERC-20.
ERC-777 Compared With Other Token Standards
- ERC-20: simple transfer and approve functions with no hooks. Most wallets and DeFi apps are built around it.
- ERC-777: adds operators and hooks on sending and receiving. It needs the ERC-1820 registry.
- ERC-827: tried to let a token transfer also call another contract. It never became a final standard.
- ERC-1155: one contract can manage many fungible and non-fungible tokens. It also calls the receiver when tokens arrive.
How Developers Guard Against Hooks
- Checks, effects, interactions: update balances and records first, and make external calls last.
- Reentrancy guards: a lock that stops a function from being entered again before it finishes. OpenZeppelin’s ReentrancyGuard is a common example.
- Token allowlists: lending markets and other protocols often accept only tokens they have reviewed.
- Callback tests: audits check how a contract behaves when a token calls back during a transfer.
These steps help with any token that runs code during a transfer, not only ERC-777.
Frequently Asked Questions
Is ERC-777 still used?
Rarely for new tokens. The standard is still listed as Final on eips.ethereum.org, so existing ERC-777 tokens keep working. But OpenZeppelin removed its implementation in Contracts 5.0 in October 2023, and most projects choose ERC-20, often with extensions such as permit signatures. Developers mainly need to know ERC-777 so their contracts handle its callbacks safely.
What is a hook in ERC-777?
A hook is a function that runs automatically when tokens move. tokensToSend is called on the holder’s side before tokens leave, and tokensReceived is called on the recipient’s side after tokens arrive. Either can reject the transfer. Hooks allow useful automation, but they also hand control to outside code during a transfer.
How did ERC-777 lead to the 2020 Uniswap and Lendf.Me losses?
Both attacks used imBTC, an ERC-777 token, and its hooks to re-enter contracts before their records were updated. On April 18, 2020, the attacker drained the imBTC pool on Uniswap v1, and on April 19 a similar attack took about $25 million from Lendf.Me. The flaw was in how those contracts handled the callbacks.
Can ERC-777 tokens be used in DeFi?
They can, but only safely where protocols are built to handle their hooks. Many lending markets and exchanges accept only tokens they have reviewed, partly because of the 2020 imBTC attacks. Because ERC-777 tokens can expose ERC-20 functions, they may seem to work in apps that never planned for callbacks. That gap is where the risk lies.
Data sources: EIP-777 on eips.ethereum.org; imToken’s April 2020 statement on imBTC; OpenZeppelin’s Contracts 5.0 announcement of October 5, 2023; read November 16, 2026.