ERC-20 is a standard interface that all fungible tokens on Ethereum follow. It defines a common set of functions (transfer, balanceOf, approve, transferFrom) so that any ERC-20 token works with any wallet, exchange, or DeFi protocol without custom integration. It is why you can trade thousands of different tokens on Uniswap with one interface, they all speak the same language.

What Is a Token Standard (ERC-20 Explained Simply)?

3 min read

The short version

ERC-20 is like a universal plug standard for tokens. Just as any USB-C device works with any USB-C port, any ERC-20 token works with any ERC-20 compatible wallet or exchange. Without this standard, each new token would need custom integration with every service, which would make the ecosystem unusably fragmented.

How It Works

An ERC-20 contract must implement these functions: totalSupply(), how many tokens exist. balanceOf(address), how many tokens an address holds. transfer(to, amount), send tokens directly. approve(spender, amount), grant another address permission to spend your tokens. transferFrom(from, to, amount), spend tokens on behalf of someone who approved you (used by DeFi protocols). allowance(owner, spender), check remaining approval. Plus two events: Transfer(from, to, amount) and Approval(owner, spender, amount). This standard enables composability: any contract can call transfer() on any token and know the interface will work. Stablecoins (USDC, DAI), governance tokens (UNI, AAVE), and wrapped assets (WBTC, WETH) are all ERC-20.

How a Uniswap swap uses ERC-20 functions

You want to swap 1000 USDC for ETH on Uniswap. (1) You call approve() on the USDC contract, granting the Uniswap Router address permission to spend 1000 USDC from your balance. (2) You call swapExactTokensForETH() on the Uniswap Router. (3) The Router calls transferFrom(you, pool, 1000) on the USDC contract, moving 1000 USDC from your address to the liquidity pool. (4) The Router calculates how much ETH you should receive based on the pool ratio. (5) The Router sends you the ETH. All of this works because USDC implements ERC-20 exactly, Uniswap never needed to write custom code for USDC specifically.

What People Get Wrong

  • ERC-20 tokens are stored in your wallet

    Tokens exist as entries in the token contract's mapping (balanceOf). Your wallet just queries the contract. "Holding" a token means the contract records your address with a non-zero balance. The tokens never leave the contract, only the accounting changes.

  • All ERC-20 tokens are safe

    ERC-20 is a technical interface, not a quality guarantee. Scam tokens, tokens with hidden admin functions (arbitrary minting, transfer blocking), and tokens with malicious code can all be technically valid ERC-20 while being dangerous to hold.

  • You need ETH to receive ERC-20 tokens

    You need ETH to send tokens (gas for the transfer transaction) but not to receive them. Anyone can send tokens to your address without you doing anything or having any ETH balance.

Sources & Further Reading

Questions People Also Ask

What is the difference between ERC-20 and a native coin like ETH?
ETH is the native asset of Ethereum, it exists at the protocol level and is used to pay gas. ERC-20 tokens are smart contracts built on top of Ethereum. To use ERC-20 tokens, you always need some ETH for gas. WETH (Wrapped ETH) is an ERC-20 version of ETH used when DeFi protocols need uniform token interfaces.
What does "approve" mean and is it dangerous?
Approve grants another address (usually a DeFi contract) permission to move your tokens. Unlimited approvals (setting amount to max) are convenient but risky, if that contract is exploited, your tokens could be drained. Best practice: approve only the exact amount needed, or use protocols that support permit (signature-based approval).
How do I create my own ERC-20 token?
Deploy a Solidity contract implementing the ERC-20 interface. OpenZeppelin provides audited templates. Deployment costs ~$50-$200 in gas. The token exists immediately, but having a token listed, liquid, and valued is an entirely separate challenge from creating one.

More in Smart Contracts & Ethereum

See all →
Was this page helpful?

Page last checked