Blockchain & Crypto Fundamentals

ERC-20

The standard token interface on Ethereum defining functions like transfer, approve, and balanceOf for fungible tokens.

ERC-20 — ERC-20 is the most widely used token standard on Ethereum and EVM-compatible blockchains, defining a common set of rules that fungible tokens must follow. Any token implementing the ERC-20 interface can be traded on decentralized exchanges, stored in standard wallets, and integrated into DeFi protocols without custom code.

How ERC-20 Works

The ERC-20 standard specifies six mandatory functions and two events that a token smart contract must implement: totalSupply, balanceOf, transfer, transferFrom, approve, and allowance. These functions enable basic operations like checking balances, sending tokens between addresses, and granting third-party contracts permission to spend tokens on behalf of a user.

When a developer deploys an ERC-20 token, they define the token name, symbol, decimal places (typically 18), and total supply. The contract maintains a mapping of addresses to balances, and every transfer updates this mapping. Because every ERC-20 token exposes the same interface, DEX routers, lending protocols, and portfolio trackers can interact with any ERC-20 token using identical function calls.

The approve and transferFrom pattern is essential for DeFi interactions. Before a DEX can swap your tokens, you must first approve the router contract to spend a specific amount. This two-step process is a common source of confusion for new users but is a deliberate security feature that prevents contracts from moving tokens without explicit permission.

Why ERC-20 Matters

ERC-20 is the foundation of the fungible token economy. Stablecoins like USDT and USDC, governance tokens like UNI and AAVE, and thousands of DeFi tokens all follow this standard. Its universality means that any new ERC-20 token is immediately compatible with the entire EVM DeFi ecosystem — it can be listed on Uniswap, used as collateral on Aave, or bridged to Layer-2 networks without any protocol-level changes.

For traders, understanding ERC-20 is essential because it governs how tokens are transferred, approved, and taxed. Some ERC-20 contracts add custom logic like transfer taxes (buy/sell fees), maximum transaction amounts, or wallet holding limits. These modifications operate within the ERC-20 framework but can significantly impact trading behavior and profitability.

Real-World Example

When a new memecoin launches on Ethereum, the creator deploys an ERC-20 contract specifying a total supply of, say, 1 billion tokens with 18 decimals. They pair the token with ETH in a Uniswap V2 or V3 pool. Traders use the standard approval flow: first calling approve on the token contract to authorize the Uniswap router, then calling the router's swap function. Block explorers like Etherscan display the contract's ERC-20 function calls, holder distribution, and transfer history, all made possible by the standardized interface.

Common questions about ERC-20 in cryptocurrency and DeFi.

ERC-20 defines fungible tokens where each unit is identical and interchangeable, like USDC or UNI. ERC-721 defines non-fungible tokens (NFTs) where each token has a unique ID and properties. A third standard, ERC-1155, supports both fungible and non-fungible tokens in a single contract.

BNB Chain is EVM-compatible, so it uses the same token interface. However, tokens on BNB Chain are technically called BEP-20 tokens. The function signatures and behavior are identical to ERC-20, but the token exists on a different blockchain with different validators and gas fees.

ERC-20's approve mechanism is a security feature. It prevents smart contracts from spending your tokens without permission. When you approve a DEX router, you authorize it to transfer a specific amount of tokens from your wallet. Many wallets allow you to set a custom approval amount instead of unlimited approval, reducing risk if the router contract is compromised.

Ready to put your knowledge into practice?

Start Boosting