Skip to main content

ERC-20 Standard


IERC20Metadata

IERC20Metadata.solInterface for IERC20Metadata Fungible Tokens
1interface IERC20Metadata is IERC20 { {
2 function name() external view returns (string memory);
3 function symbol() external view returns (string memory);
4 function decimals() external view returns (uint8);
5}

IERC-20

IERC-20.solInterface for ERC-20 Fungible Tokens
1interface IERC20 {
2 event Transfer(address indexed from, address indexed to, uint256 value);
3 event Approval(address indexed owner, address indexed spender, uint256 value);
4 function totalSupply() external view returns (uint256);
5 function balanceOf(address account) external view returns (uint256);
6 function transfer(address to, uint256 value) external returns (bool);
7 function allowance(address owner, address spender) external view returns (uint256);
8 function approve(address spender, uint256 value) external returns (bool);
9 function transferFrom(address from, address to, uint256 value) external returns (bool);
10}

ERC-20 Functions

The different implementation correspond to the patterns (depending on where they have the supply)

ERC-20.solERC-20 Fungible Tokens
1interface IERC20 {
2 ...
3 function name() external view returns (string memory);
4 function symbol() external view returns (string memory);
5 function decimals() external view returns (uint8);
6 function totalSupply() external view returns (uint256);
7 function balanceOf(address account) external view returns (uint256);
8 function transfer(address to, uint256 value) external returns (bool);
9 function allowance(address owner, address spender) external view returns (uint256);
10 function approve(address spender, uint256 value) external returns (bool);
11 function transferFrom(address from, address to, uint256 value) external returns (bool);
12 event Transfer(address indexed from, address indexed to, uint256 value);
13 event Approval(address indexed owner, address indexed spender, uint256 value);
14}

ERC-20 Storage

ERC-20.solERC-20 Fungible Tokens
1interface IERC20 {
2 string private _name;
3 string private _symbol;
4 uint256 private _totalSupply;
5 mapping(address account => uint256) private _balances;
6 mapping(address account => mapping(address spender => uint256)) private _allowances;
7 ...
8}

ERC-20 Extensions

ERCTitleDescription
ERC-7632Interfaces for Named TokenEnable tokens to have a string name and be able to convert between name and id.
ERC-223Token with transaction handling modelToken with transaction handling model designed to behave identical to native currency (ether)
ERC-7417Token ConverterSmart-contract service that converts token of one ERC version to another
ERC-7729Token with MetadataAn ERC-20 extension for tokens with metadata.
ERC-7196Simple token, Simplified ERC-20Designed for smart contract wallets, this removes the transferFrom, approve, and allowance functions from ERC-20 tokens.
ERC-6808Fungible Key Bound TokenAn interface for Fungible Key Bound Tokens, also known as a FKBT.
ERC-5744Latent Fungible TokenAn interface for tokens that become fungible after a period of time.
ERC-5727Semi-Fungible Soulbound TokenAn interface for soulbound tokens, also known as badges or account-bound tokens, that can be both fungible and non-fungible.
ERC-3386ERC-721 and ERC-1155 to ERC-20 WrapperA standard interface for contracts that create generic ERC-20 tokens which derive from a pool of unique ERC-721/ERC-1155 tokens.
ERC-3525Semi-Fungible TokenDefines a specification where ERC-721 compatible tokens with the same SLOT and different IDs are fungible.
ERC-1633Re-Fungible Token Standard (RFT)ERC-20 extension for proportional ownership of an ERC-721 token.
ERC-777Token StandardThis EIP defines standard interfaces and behaviors for token contracts.