Ethereum: Smart Contracts in Practice
ERC-20: The Fungible Token Standard · 1/2

A shared interface is the whole point

ERC-20 isn't a piece of code you install, it's an interface: a small set of functions and events that a contract must implement to be recognized as a standard fungible token. The core functions are `transfer(to, amount)`, `balanceOf(owner)`, `approve(spender, amount)`, `allowance(owner, spender)`, and `transferFrom(from, to, amount)`, plus a `Transfer` and `Approval` event. Any contract implementing exactly this interface, regardless of what it's actually for, a stablecoin, a governance token, a wrapped asset, is an ERC-20 token as far as the rest of the ecosystem is concerned.

This shared interface is what makes the token economy composable. A wallet like MetaMask doesn't need custom code for every token that exists, it just calls `balanceOf` and `transfer` and trusts that any ERC-20-compliant contract will respond correctly. An exchange can list a brand-new token the day it launches without writing a single line of integration code, because it already knows how to talk to anything that speaks ERC-20. Without that agreed-upon interface, every wallet and every exchange would need bespoke code for every single token, which simply wouldn't scale.