Post
Topic
Board Altcoin Discussion
Re: Ethereum ERC20 code?
by
romeo-karrera
on 19/07/2017, 11:41:54 UTC
That's the basic code which you need to create a token. You'll probably want to add more smart contract code to allow for vesting and stuff like that.

What all do i need to add to make it an ERC20 standard code?

I found this: https://theethereum.wiki/w/index.php/ERC20_Token_Standard
and that basic code at https://www.ethereum.org/token#the-code covers all these functions.....so does that mean it is erc20?


Code:
/// @title ERC20 interface see https://github.com/ethereum/EIPs/issues/20
 /// mail@smartcontracteam.com
contract ERC20 {
  uint public totalSupply;
  function balanceOf(address who) constant returns (uint);
  function allowance(address owner, address spender) constant returns (uint);
  function transfer(address to, uint value) returns (bool ok);
  function transferFrom(address from, address to, uint value) returns (bool ok);
  function approve(address spender, uint value) returns (bool ok);
  event Transfer(address indexed from, address indexed to, uint value);
  event Approval(address indexed owner, address indexed spender, uint value);
}