ERC-20

The standard interface for fungible tokens on Ethereum, defining common rules for transfer, approval, and balance queries.

What Is ERC-20?

ERC-20 is the most widely adopted token standard on Ethereum, defining a common interface that every compliant fungible token must implement. The acronym stands for "Ethereum Request for Comment 20," referencing the proposal number in Ethereum's improvement process. By establishing a universal set of functions — including transfer, approve, balance queries, and allowance management — ERC-20 ensures that any compliant token can work seamlessly with wallets, decentralized exchanges, lending protocols, and other smart contracts without custom integration code.

The History Behind ERC-20

Before ERC-20 was proposed by Fabian Vogelsteller in November 2015 and formalized in 2017, each token contract on Ethereum implemented its own unique interface. This meant that every wallet, exchange, and application had to write custom code to support each new token — an approach that was tedious, error-prone, and unscalable. ERC-20 solved this fragmentation by providing a standard API that the entire ecosystem could agree on.

The impact was transformative. The 2017 ICO boom was built almost entirely on ERC-20 tokens, as the standard made it trivially easy to create, distribute, and trade new tokens. Today, tens of thousands of ERC-20 tokens exist, ranging from major stablecoins to governance tokens to meme coins.

How ERC-20 Works

The ERC-20 standard specifies six mandatory functions and two optional metadata fields that every compliant token contract must implement:

Required Functions

  • totalSupply(): Returns the total number of tokens in existence.
  • balanceOf(address): Returns the token balance of a specific address.
  • transfer(to, amount): Moves tokens from the caller's account to another address.
  • approve(spender, amount): Grants a third-party contract permission to spend up to a specified number of tokens on the owner's behalf.
  • allowance(owner, spender): Returns how many tokens a spender is still allowed to withdraw from an owner.
  • transferFrom(from, to, amount): Moves tokens from one address to another, using the allowance mechanism — this is how DeFi protocols interact with your tokens.

Optional Fields

  • name(): A human-readable name (e.g., "USD Coin").
  • symbol(): A ticker symbol (e.g., "USDC").
  • decimals(): The number of decimal places the token uses (most use 18, though USDC and USDT use 6).

The approve-and-transferFrom pattern is especially important for DeFi. When you "approve" a lending protocol to spend your tokens, you are granting its smart contract an allowance. The protocol can then call transferFrom to move tokens from your wallet into its contracts — for instance, when you deposit collateral or supply liquidity.

ERC-20 Tokens in DeFi

Virtually every major DeFi token follows the ERC-20 standard, making it the backbone of decentralized finance on Ethereum and EVM-compatible chains:

  • Stablecoins: USDC, USDT, and DAI are all ERC-20 tokens that serve as the primary units of account in lending and borrowing markets.
  • Governance tokens: AAVE, UNI, COMP, and MKR give holders voting power over protocol upgrades and parameter changes.
  • Wrapped Bitcoin (WBTC): An ERC-20 representation of Bitcoin, enabling BTC holders to participate in Ethereum-based DeFi without selling their Bitcoin. Lending aggregators facilitate this process by auto-wrapping BTC collateral for use across DeFi lending protocols.
  • Liquid staking tokens: stETH and cbETH represent staked ETH positions as tradeable ERC-20 tokens.

Limitations and Known Issues

Despite its widespread adoption, ERC-20 has notable limitations:

  • No receive callback: ERC-20 does not include a mechanism to notify a receiving contract that tokens have arrived. If a user sends tokens directly to a contract that is not designed to handle them, those tokens can be permanently locked and unrecoverable. This has resulted in millions of dollars in lost funds over the years.
  • Approval race conditions: The approve function can be exploited in a specific edge case where a spender front-runs an allowance change, spending both the old and new allowance. The increaseAllowance/decreaseAllowance pattern was introduced to mitigate this.
  • No built-in metadata standard: ERC-20 tokens do not natively support rich metadata like icons or descriptions, which is handled by off-chain registries.

Standards Built on ERC-20

Several newer standards extend ERC-20 to address its shortcomings or add functionality:

  • ERC-4626: A tokenized vault standard that adds deposit, withdraw, and yield-accounting functions on top of ERC-20. It has become the standard for lending pools, yield aggregators, and staking contracts.
  • ERC-777: An advanced token standard with receive hooks and operator permissions, though it has seen limited adoption due to added complexity and reentrancy attack vectors.
  • ERC-2612 (Permit): Adds gasless approval via signed messages, allowing users to approve and transfer in a single transaction rather than two separate ones.

Why ERC-20 Matters

ERC-20's significance extends far beyond Ethereum. The standard has been replicated across virtually every EVM-compatible blockchain — Arbitrum, BASE, Polygon, BSC, and Optimism all use the same interface for their fungible tokens. This cross-chain consistency is what allows DeFi protocols to deploy on multiple networks with minimal modifications and enables users to move assets across chains using bridges. For anyone interacting with DeFi, understanding ERC-20 is foundational — it is the universal language that tokens speak.

Related Terms