ICO and ERC20 Token

What is ICO


ICO or Initial Coin Offering means publishing a token smart contract on Ethereum Blockchain.


These are fixed number of tokens which can be bough at an auction, fixed price etc from a fixed date. This token contract has to follow a standard interface which we call ERC20 Pattern.

ERC 20

ERC stands for Ethereum Request for Comments proposal which is a project containing Ethereum Improvement Proposals. Its 20th Ethereum request for comments is Standard Token Contract known as ERC20 Contract.
In nutshell, ERC20 Contract is standard set of functions for,

Why to Standardize

Suppose we build our application to interact with an ERC20 Contract. Standardization of ERC20 contract facilitates our application to interact with any ERC20 contract. Hence, we can collect multiple varieties of tokens in our contract just by plugging in the new token contact address without any custom code.

Contract Interface


 ----------------------------------------------------------------------------
 ERC Token Standard #20 Interface
 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
 ----------------------------------------------------------------------------
contract ERC20Interface {

  string public constant name = "Token Name";
  string public constant symbol = "SYM";
  uint8 public constant decimals = 18;

  function totalSupply() public constant returns (uint);
  function balanceOf(address tokenOwner) public constant returns (uint balance);
  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);
  function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
  event Transfer(address indexed from, address indexed to, uint tokens);
  event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}


Method Definition

function totalSupply() public constant returns (uint);


function balanceOf(address tokenOwner) public constant returns (uint balance);


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);


function allowance(address tokenOwner, address spender) public constant returns (uint remaining);


event Transfer(address indexed from, address indexed to, uint tokens);


event Approval(address indexed tokenOwner, address indexed spender, uint tokens);


ERC20 Token Variables

References

SUBSCRIBE TO NEW CONTENT

Tutorials on System Design, BlockChain, Design Patterns and more sent out once a week.

Loading comments...