已經紅一陣子的名詞叫做ICO
ICO 是 Initial Coin Offering縮寫
而目前大部分所提到的ICO幾乎都是以太坊 ERC20 Token 智能合約
其實這個不叫做coin應該要叫做token,但是為了講解方便,因此都以coin來說
主要是目前比特幣很紅,發行者為了沾上邊,因此開始發行一堆幣,來圈錢
而如何發行自己的Coin呢,其實非常簡單,在之後的文章會有教學
而ERC20類似一個interface,使用者會去繼承並且實作ERC20
而ERC20 中有:
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);
}
因此如果有以上這些功能的我們稱作是ERC20 Token
而使用者就可以進行coin的轉移,如:transfer 或者 transferFrom