What is ERC20 token?

If you come across any ICOs, you must have heard of ERC20 token. In fact, majority ICO tokens are ERC20 compatible. What does that mean? It is extremely simple, ERC20 is a standard proposed back in 2013 to standardize smart contract on Ethereum blockchain. Basically it provides interfaces a smart contract must implement to be ERC20 compatible. So what’s the interfaces look like?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);

event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}

If you want to read details of what interfaces are optional, what are mandatory, following the link in the code. It takes about 1 minute to create a ERC20 smart contract token from scratch, in fact, there are lots of existing code you can copy paste and modify the name of the coin to issue an new coin. That’s why there are so many shitty coins out there. Don’t wait! Go and create your own coins and ask your friends and family to invest in your coin!

Reference:
https://theethereum.wiki/w/index.php/ERC20_Token_Standard
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md