On Ethereum, tokens can represent almost anything: reputation points, an in-game skill, a share in a company, a fiat currency such as USD or an ounce of gold. To keep all these tokens compatible with wallets, exchanges and apps, developers use shared standards. The best known of these is ERC-20.
What is ERC-20?
ERC-20 (Ethereum Request for Comments 20) was proposed by Fabian Vogelsteller in November 2015. It is a standard for fungible tokens: every token of the same type is identical in type and value, just as one ETH equals any other ETH. Any smart contract that implements the standard methods and events counts as an ERC-20 token contract, and it keeps track of the tokens it creates.
What the standard lets you do
- transfer tokens from one account to another
- check an account’s token balance
- read the total supply of the token
- approve a third-party account to spend a set amount of your tokens
The core functions
name(),symbol(),decimals()– basic token informationtotalSupply()andbalanceOf(address)– supply and balancestransfer()andtransferFrom()– moving tokensapprove()andallowance()– letting another address (often a smart contract) spend tokens for you- Events:
TransferandApproval
Why approvals matter for your safety
When you use an app, you often approve its smart contract to spend your tokens. The European supervisory authorities’ crypto-fraud factsheet advises revoking suspicious permissions you have given to smart contracts. Many wallets and blockchain explorers can show which contracts can currently spend your tokens. Read more about how Web3 wallets work. ERC-20 tokens can also be used on Ethereum layer 2 networks.
Risk notice: crypto-assets are highly volatile and you can lose all the money you put in. This article is general information, not financial or investment advice. Always verify smart contracts, wallets and service providers yourself before using them.
