1. 程式人生 > >ERC20代幣技術標準

ERC20代幣技術標準

ERC20代幣技術標準

參考連結:http://www.ethdocs.org/en/latest/ethereum-clients/go-ethereum/index.html
https://github.com/ethereum/wiki/wiki/JSON-RPC
http://remix.ethereum.org/#optimize=false&version=soljson-v0.5.0+commit.1d4f565a.js
https://github.com/ethereum/go-ethereum/wiki/Private-network
https://theethereum.wiki/w/index.php/ERC20_Token_Standard


在這裡插入圖片描述

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

在這裡插入圖片描述