Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Glossary

ERC-777

ERC-777 is an advanced Ethereum token standard for fungible tokens that introduces operator permissions and built-in transaction hooks for improved composability and security.
Chainscore © 2026
definition
TOKEN STANDARD

What is ERC-777?

ERC-777 is an advanced Ethereum token standard that builds upon ERC-20, introducing native hooks and operator permissions for more secure and flexible token interactions.

ERC-777 is an Ethereum Request for Comments (ERC) standard for fungible tokens that enhances the widely used ERC-20 standard with features like send/receive hooks and a concept of trusted operators. The primary innovation is its tokensReceived and tokensToSend hooks, which are functions automatically invoked when tokens are sent to or from a contract. This allows smart contracts to react to incoming transactions atomically, preventing tokens from being stuck in contracts that cannot handle them—a common issue with ERC-20. It also maintains backward compatibility with ERC-20, meaning existing wallets and exchanges can still interact with ERC-777 tokens.

A key security feature of ERC-777 is its granular permission system. While ERC-20 requires users to approve a spender for a specific amount, ERC-777 introduces operators—addresses authorized to send tokens on a user's behalf. This can be more secure and gas-efficient for recurring transactions, such as subscriptions. However, the standard's initial implementation was involved in a notable reentrancy attack during its audit, leading to the creation of the ERC-1820 registry contract to safely manage interface detection for the hook functions, ensuring secure adoption.

The standard enables sophisticated DeFi (Decentralized Finance) and payment logic. For example, a streaming payments contract could use the tokensReceived hook to immediately invest received funds into a yield vault, all within a single transaction. Despite its technical advantages, ERC-777 adoption has been limited, partly due to the complexity of the hook mechanism and the dominance of the simpler ERC-20 and the non-fungible-focused ERC-721. Its concepts, however, have influenced later standards like ERC-1155 for multi-token contracts.

etymology-history
STANDARD EVOLUTION

Etymology & History

The development of ERC-777 is a key chapter in the evolution of token standards, representing a direct response to the limitations of its predecessor, ERC-20.

The ERC-777 token standard, proposed in November 2017 by Jacques Dafflon, Jordi Baylina, and Thomas Shababi, was designed as a backward-compatible successor to the ubiquitous ERC-20. Its primary goal was to address critical shortcomings in user experience and security, most notably the problem of accidentally sent tokens. The standard's designation follows the Ethereum Request for Comment (ERC) numbering convention, with 777 chosen as a memorable sequence distinct from the 20-series, signaling a significant, non-incremental upgrade.

The historical catalyst for ERC-777 was the widespread issue of token loss inherent to ERC-20. Because ERC-20's transfer function is a simple, one-way operation, tokens sent to a contract that couldn't handle them (like a multi-signature wallet not designed for that specific token) became permanently stuck. ERC-777 introduced a revolutionary hooks mechanism, allowing recipient contracts to accept or reject tokens via a tokensReceived function. This "send with intent" model, inspired by the ERC-223 proposal, made transactions far safer by design.

Despite its technical superiority, ERC-777's adoption was significantly hampered by a major security vulnerability discovered in 2020. The standard's design allowed for reentrancy attacks through its approval mechanism, a flaw that was exploited in several high-profile incidents. This event underscored the critical importance of rigorous security auditing for new token standards. Consequently, while ERC-777 demonstrated powerful concepts like operator permissions and improved metadata, its complex security model led many projects to favor the simpler, more battle-tested ERC-20 or await the development of subsequent standards.

key-features
ERC-777

Key Features

ERC-777 is a token standard for fungible tokens that introduces advanced features like operator permissions and send/receive hooks, building upon and improving ERC-20.

01

Backward Compatibility

ERC-777 tokens are fully backward compatible with ERC-20. This means any wallet, exchange, or smart contract that works with ERC-20 tokens will also work with ERC-777 tokens without modification. It achieves this by implementing the standard ERC-20 functions.

02

Operators & Granular Permissions

The standard introduces the concept of operators—trusted addresses authorized to send tokens on behalf of a holder. This enables use cases like automated subscriptions or gas-less transactions managed by a third-party service.

03

Send & Receive Hooks

This is the core innovation. Contracts and regular addresses can implement hooks:

  • tokensToSend: Called in the sender's contract before debiting balances.
  • tokensReceived: Called in the recipient's contract after crediting balances. This allows for atomic, conditional transactions and prevents tokens from being stuck in contracts that cannot handle them.
04

Improved Transaction Semantics

ERC-777 uses a single send function with a consistent, intuitive data field, replacing ERC-20's dual transfer/transferFrom model. This simplifies the developer experience and reduces errors. The data field can carry information for the receive hook.

05

Enhanced Security (vs. ERC-20)

The standard addresses the ERC-20 approval race condition by decoupling approval and transfer. It also mitigates the problem of tokens being accidentally sent to contracts that cannot interact with them, as the receive hook can reject the transaction.

06

Real-World Implementation

A prominent example is the Superfluid money streaming protocol, which uses ERC-777 hooks to enable real-time finance. When a stream is updated or canceled, the hooks allow for immediate balance reconciliation within a single transaction.

how-it-works
TOKEN STANDARD

How ERC-777 Works

An in-depth look at the ERC-777 token standard, which enhances the widely used ERC-20 with advanced features like operator permissions and hooks for secure, complex interactions.

The ERC-777 is an Ethereum token standard that builds upon and is backward compatible with ERC-20, introducing a more advanced feature set for token contracts. Its core innovation is the concept of operators—trusted addresses authorized to send tokens on behalf of a holder—and send/receive hooks. These hooks are functions that are called in both the sending and receiving contracts, allowing for atomic, conditional transactions and enabling complex logic like fee collection or mandatory compliance checks during a transfer, which was impossible with ERC-20's simple transfer model.

A key mechanism is the tokensToSend and tokensReceived hooks. When a user initiates a transfer, the tokensToSend hook in their wallet contract executes first, allowing for pre-transfer logic such as balance verification. Upon arrival, the tokensReceived hook in the recipient's contract is triggered, enabling actions like auto-staking, registering the holder, or rejecting unauthorized transfers. This two-way communication prevents the common ERC-20 problem where tokens sent to a contract that cannot handle them become permanently locked, as a contract can now implement tokensReceived to accept or revert the transaction.

The standard also formalizes the operator system, where a token holder can authorize specific addresses (e.g., a decentralized exchange or payment processor) to manage their tokens. This enables gas-less transactions, where the operator pays the gas fee, and batch operations. Furthermore, ERC-777 uses a single send function instead of ERC-20's dual transfer/approve+transferFrom, streamlining the user experience and reducing the risk of front-running attacks associated with the approval mechanism. Its design makes it particularly suitable for complex DeFi applications requiring secure, automated token interactions.

code-example
ERC-777 IMPLEMENTATION

Code Example: Core Interface

This section dissects the fundamental `IERC777` interface, which defines the mandatory functions and events a token must implement to be ERC-777 compliant.

The IERC777 interface is the foundational contract that establishes the standard's core operational logic, extending the IERC20 interface for backward compatibility. It introduces several critical functions: name, symbol, granularity, totalSupply, balanceOf, send, operatorSend, burn, and operatorBurn. Crucially, it also defines the defaultOperators array and the authorizeOperator/revokeOperator/isOperatorFor functions, which enable the operator model central to ERC-777's advanced functionality.

A key implementation detail is the tokensToSend and tokensReceived hooks. These are functions that must be called within the token contract's send, mint, burn, and operator functions. The tokensToSend hook is invoked in the sender's contract before the state change, allowing for custom logic like imposing fees or validating the transaction. Conversely, the tokensReceived hook is called in the recipient's contract after the balance update, enabling automatic processing, such as registering the deposit in a smart contract.

The interface mandates specific events for transparent on-chain logging. The Sent and Minted events are emitted for transfers and new token creation, while Burned logs token destruction. The AuthorizedOperator and RevokedOperator events track changes to operator permissions. These events provide a standardized way for external systems, like wallets and block explorers, to track token movements and permission changes reliably across all ERC-777 implementations.

Developers implementing this interface must carefully manage the interaction between ERC-777 and ERC-20. Since IERC777 inherits from IERC20, the standard's send function must be compatible with ERC-20's transfer and transferFrom. This is typically handled by having the ERC-777 send function call the internal _send method, which triggers the hooks, while the ERC-20 functions are overridden to also route through this same internal mechanism, ensuring consistent hook execution regardless of the entry point.

Understanding this core interface is essential for both token creators and integrators. For creators, it provides the blueprint for a compliant token with advanced features. For integrators, such as exchanges or wallet developers, it defines the predictable ABI (Application Binary Interface) for interacting with any ERC-777 token, enabling support for its unique operator model and hook system without custom code for each new token.

security-considerations
ERC-777

Security Considerations & Risks

ERC-777 is an advanced token standard that introduces powerful features like hooks and operators, but these capabilities also create unique attack vectors and complexities that developers must carefully manage.

01

The Reentrancy Attack Vector

The tokensReceived and tokensToSend hooks allow for arbitrary code execution during transfers, creating a classic reentrancy risk. A malicious contract receiving tokens can call back into the sender's contract before the initial transfer is finalized, potentially draining funds. This is similar to the vulnerability exploited in the 2016 DAO hack but is a fundamental design aspect of ERC-777's hook system.

02

Operator Trust & Centralization

ERC-777 introduces operators—addresses authorized to send tokens on behalf of a holder. This creates a trust and centralization risk:

  • A compromised operator can drain all tokens from accounts that authorized it.
  • Users may inadvertently grant excessive permissions to poorly secured dApps or contracts.
  • The standard requires explicit user approval for each operator, but UX patterns can obscure this risk.
03

Compatibility & Integration Risks

ERC-777's advanced features can break compatibility and create integration hazards:

  • Backwards Incompatibility: Not all ERC-20 wallets and exchanges support ERC-777, leading to potential fund loss if sent to an incompatible address.
  • Unexpected Behavior: Contracts expecting simple ERC-20 transfers may malfunction when interacting with ERC-777's hook logic, causing failed transactions or locked funds.
  • The standard requires extra validation in integrating contracts to safely handle both token types.
04

The Implicit vs. Explicit Balance Issue

A critical design flaw in the initial proposal was the discrepancy between implicit and explicit balances. The tokensToSend hook could prevent a debit, but the tokensReceived hook could reject a credit, leaving the total supply invariant but individual balances in an inconsistent state. This could be exploited to create tokens from nothing or freeze funds. Later implementations and the final standard require rigorous checks to mitigate this.

05

Increased Attack Surface & Gas Complexity

The hook mechanism significantly expands the attack surface of a token contract:

  • Each transfer becomes a potential interaction with an external, untrusted contract.
  • Gas costs are unpredictable and can be driven high by malicious hook contracts, leading to failed transactions or denial-of-service.
  • Auditing is more complex as the token's state can be altered by callback logic outside the main contract, breaking standard invariant checks.
06

Mitigation & Best Practices

To use ERC-777 securely, developers should adopt specific mitigation strategies:

  • Apply the Checks-Effects-Interactions pattern rigorously to prevent reentrancy in hook implementations.
  • Use ERC777Sender and ERC777Recipient interfaces correctly to signal and validate hook support.
  • Implement a strict allowlist or circuit breaker for operators to limit blast radius.
  • Thoroughly audit any contract implementing hooks, treating them with the same scrutiny as a main contract function.
TOKEN STANDARDS

ERC-777 vs. ERC-20: A Comparison

A technical comparison of the core features and mechanisms of the ERC-777 and ERC-20 token standards on Ethereum.

FeatureERC-20ERC-777

Primary Function

Basic fungible token standard

Advanced fungible token standard with operator control

Transfer Mechanism

Simple transfer and transferFrom

send with data field and operator hooks

Transaction Reversion on Failure

Returns false

Reverts entire transaction

Approval Model

Static allowance per spender

Dynamic operator authorization (can be revoked)

Receive Hooks

Granular Permission Control

Backward Compatibility

N/A (baseline)

Can interact with ERC-20 wallets and contracts

Default Decimal Precision

18

18

ecosystem-usage
ERC-777

Ecosystem Usage & Examples

The ERC-777 token standard extends ERC-20 with advanced features like operator permissions and send/receive hooks, enabling more complex transaction logic and improved compatibility with existing infrastructure.

01

Send/Receive Hooks

The defining feature of ERC-777 is the tokensToSend and tokensReceived hooks. These are functions called automatically in the sender's and recipient's contracts, allowing for atomic, conditional logic on transfers.

  • A decentralized exchange can receive tokens and instantly trade them in a single transaction.
  • A smart contract wallet can require multi-signature approval before allowing tokens to be sent.
  • This prevents the common ERC-20 pattern where users must first approve and then call a separate function, reducing complexity and gas costs for certain operations.
02

Operators & Granular Permissions

ERC-777 introduces the concept of operators—trusted addresses (like smart contracts) authorized to send tokens on a user's behalf. This is more granular than ERC-20's blanket approve function.

  • An auction contract can be authorized as an operator to transfer a user's tokens only if they win a bid.
  • A payment processor can be set as a default operator for all users, streamlining subscription payments.
  • Operators can be revoked individually, providing better security and control over delegated spending.
03

Backward Compatibility with ERC-20

ERC-777 tokens are designed to be backward compatible with the ERC-20 standard. They implement all required ERC-20 functions, meaning they can interact with every wallet, exchange, and contract that supports ERC-20.

  • Wallets like MetaMask can hold and transfer ERC-777 tokens using the standard interface.
  • Decentralized exchanges (DEXs) built for ERC-20 can list ERC-777 tokens without modification.
  • This compatibility was crucial for adoption, allowing the new standard to leverage the massive existing ERC-20 ecosystem.
04

Real-World Implementation: Golem (GLM)

Golem Network migrated its GNT token to the ERC-777-compliant GLM token. This migration showcased key ERC-777 benefits:

  • Atomic Swaps for Payments: Providers on the Golem network can receive GLM tokens and, via the tokensReceived hook, automatically register the payment and release computational results in one transaction.
  • Enhanced Utility: The hook system allows the Golem smart contract infrastructure to react programmatically to incoming payments, creating a more seamless user experience compared to the previous ERC-20 model requiring multiple steps.
05

Security Considerations & The DAO Hack Patch

The ERC-777 standard includes built-in mitigations for a reentrancy attack vector it could introduce. The tokensReceived hook, if not carefully implemented, could allow malicious contracts to re-enter the token contract during a transfer.

  • The standard mandates the ERC1820 registry to securely identify which contracts implement hooks.
  • Developers must follow the checks-effects-interactions pattern rigorously in their hook logic.
  • This proactive design addresses the type of vulnerability famously exploited in The DAO hack, making the ecosystem more secure when hooks are used correctly.
06

Comparison to ERC-1155

While both are advanced token standards, ERC-777 and ERC-1155 (Multi Token) serve different primary use cases.

  • ERC-777: Focuses on enhancing fungible tokens with transaction hooks and operators. Ideal for sophisticated financial applications and improving user experience for a single token.
  • ERC-1155: Focuses on gas efficiency for batch operations and managing both fungible and non-fungible tokens within a single contract. Ideal for gaming asset marketplaces and projects issuing large collections.
  • ERC-777's hooks provide deeper, per-transfer programmability, while ERC-1155 optimizes for scalability and mixed asset types.
ERC-777

Common Misconceptions

The ERC-777 token standard introduced advanced features like hooks and operator permissions, but its complexity and a critical vulnerability have led to widespread confusion about its safety and purpose. This section clarifies the most frequent misunderstandings.

No, ERC-777 is not a simple upgrade but a more complex alternative to ERC-20 with fundamentally different mechanics. While it is backward compatible with ERC-20, meaning ERC-777 tokens can interact with wallets and contracts expecting ERC-20, its core innovation is the send/receive hooks mechanism. These hooks allow token contracts and recipient addresses to be notified of incoming transactions and execute code before the transfer finalizes, enabling features like rejecting unwanted tokens or automating actions. This design makes it more feature-rich but also introduced significant attack surfaces not present in the simpler ERC-20 standard.

ERC-777

Frequently Asked Questions (FAQ)

Common questions about the ERC-777 token standard, its advanced features, and how it compares to other standards like ERC-20.

ERC-777 is an Ethereum token standard that improves upon ERC-20 by introducing hooks and operators for more advanced token interactions. It works by allowing token contracts to notify recipient contracts via a tokensReceived hook before a transfer is finalized, enabling atomic interactions. It also introduces operators, which are trusted addresses (like a decentralized exchange contract) that can send tokens on behalf of a user, similar to an allowance in ERC-20 but for all tokens. The standard is backward compatible with ERC-20, meaning wallets and services that support ERC-20 can still interact with ERC-777 tokens using the old functions.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected direct pipeline
ERC-777 Token Standard: Definition & Features | ChainScore Glossary