Skip to content
  1. Home
  2. ERC Standards
  3. ERC Standards
  4. ERC-777 Explained: Hooks, Operators and Why Most Projects Avoid It Today
ERC Standards

ERC-777 Explained: Hooks, Operators and Why Most Projects Avoid It Today

ERC-777 added send/receive hooks and operators to fungible tokens. Learn how it works, the re-entrancy problems that led to its decline, and what to use instead for RWA tokens.

NUVZ Tokenization Team Updated 4 min read Technically reviewed

ERC-777 is a fungible token standard, backwards-compatible with ERC-20, that added hooks — functions called on the sender and receiver during every transfer — and “operators” who can send tokens on a holder’s behalf. It aimed to fix ERC-20’s lost-token problem and enable richer payment flows. In practice, its hooks created re-entrancy risks that contributed to real exploits, and major libraries have since deprecated it. Understanding why helps you design safer RWA tokens.

Key takeaways

  • Hooks (tokensToSend, tokensReceived) are registered through the ERC-1820 registry.
  • Operators can move tokens for holders; default operators can be set at deployment.
  • Hooks call external code mid-transfer, enabling re-entrancy against protocols that assumed ERC-20 behaviour.
  • Today, prefer ERC-20 (with careful integrations) or ERC-1155 (hooks with known patterns) — and keep compliance logic inside the token, not in external hooks.

How it works

  • send(to, amount, data) replaces transfer, carrying data for the receiver.
  • Before balances change, the sender’s tokensToSend hook is called (if registered); after, the receiver’s tokensReceived hook is called.
  • Contracts that do not register a receiver hook cannot receive tokens via send, preventing accidental loss.
  • authorizeOperator / revokeOperator replace allowances with full operator rights.

What went wrong

Many DeFi protocols integrated ERC-777 tokens as if they were ERC-20. The tokensToSend hook let attackers re-enter the protocol before state updated, draining liquidity in several incidents. Complexity (ERC-1820 dependency, operators, dual interfaces) also increased audit cost, and widely used libraries removed ERC-777 from new releases.

Not sure which token standard fits your asset?Share your asset, investor base and jurisdictions — we will recommend a standard, chain and compliance model in a free 30-minute session.
Chat with an expert

Lessons for RWA token design

  1. Avoid external callbacks in transfer paths where possible; where unavoidable (ERC-721/1155 receivers), apply checks-effects-interactions and re-entrancy guards.
  2. Keep compliance checks internal and view-only — e.g. ERC-3643 compliance modules or ERC-7943 canTransfer — rather than calling arbitrary user contracts.
  3. Be explicit about operator powers; investors and regulators need to know who can move tokens.
  4. Design for integrators’ assumptions. If your token behaves differently from ERC-20, document it and test integrations. See smart contract audits for RWA.

Should you ever use ERC-777?

Rarely. If you inherit an ERC-777 token, review every integration for re-entrancy, consider wrapping it into ERC-20, and plan a migration. For new tokens, choose ERC-20, ERC-3643 or ERC-1155.

Anatomy of a hook-based re-entrancy

A simplified version of the pattern behind real incidents:

  1. A lending or AMM protocol calls token.transferFrom(user, protocol, amount) and then updates its internal accounting.
  2. Because the token is ERC-777, the transfer triggers the sender’s tokensToSend hook before balances change.
  3. The attacker’s hook re-enters the protocol (e.g. calls borrow or swap again) while the protocol’s state still reflects the old balances.
  4. The protocol pays out more than it should; the attacker repeats until funds are drained.

The root cause is an unexpected external call in what integrators assumed was a simple balance update. The same lesson applies to ERC-721 and ERC-1155 receiver hooks.

Defensive patterns for any token with callbacks

  • Checks-effects-interactions: update state before making external calls.
  • Re-entrancy guards on functions that move value.
  • Pull over push: let users withdraw instead of pushing tokens in loops.
  • Integration allow-lists: for regulated platforms, only integrate tokens whose behaviour you have reviewed.

Wrapping an inherited ERC-777 token

If you must support an existing ERC-777 asset, a common approach is a wrapper ERC-20: users deposit the ERC-777 token into a wrapper contract (written defensively) and receive a plain ERC-20 representation that your platform integrates instead. Redemption unwraps back to ERC-777.

Frequently asked questions

Yes, it implements the ERC-20 interface, which is precisely why integrations assumed ERC-20 behaviour and were exposed to hook-based re-entrancy.

Because of its complexity, ERC-1820 dependency and the security issues caused by hooks.

Receiver checks in ERC-721/1155, permit-style approvals (ERC-2612) and account abstraction (ERC-4337) cover most of its goals more safely.

Yes, by deploying a new token and offering a 1:1 swap or wrapper, with a snapshot and clear holder communication.

Only if the sender or receiver has registered hook implementations in the ERC-1820 registry; otherwise transfers behave like ERC-20.

ERC-1155 receiver hooks also call external code, so the same defensive patterns apply — but the risks are widely understood and handled by modern libraries.

Written by the NUVZ Tokenization Team

NUVZ is the RWA and Web3 engineering brand of ESS ENN Associates (est. 1993). Our team has designed and shipped tokenization platforms for real estate, education loans, solar PPAs, energy, carbon credits, bank deposits and trade documents. About us · Case studies

This article is for general information only and is not legal, tax or investment advice. Token standards evolve — always confirm the current status of an ERC at eips.ethereum.org and take advice from qualified counsel in each jurisdiction before issuing tokens.

Keep reading

Related guides

All insights →

Get Expert Advice on Your Token Design

Questions about this standard or your own tokenization use case? Send us a note. A NUVZ engineer will reply within one business day.

Prefer a call? Pick a 30-minute slot with our team.

Book a 30-min expert call
  • Mutual NDA available before you share details
  • Reply within one business day
  • Your data is used only to answer your enquiry

Protected against spam. We never sell or share your data with third parties for marketing.

Chat with our experts