2017年8月31日 星期四

什麼是 ERC20 token

先說明 ERC-20 Token

erc20 是公認的 token interface, 定義了一個 token 應該要有哪些 functionalities,原始提案在這:https://github.com/ethereum/EIPs/issues/20

基本上有以下功能


  • totalSupply - 得知目前 token supply 的狀態
  • balanceOf - 得知特定 Account 的 Balance
  • transfer - 可以轉帳
  • approve - 授權的 Account 幫你轉帳一定額度
  • transferFrom - 從授權給你的 Account 轉帳
  • allowance - 查看授權給你的 Account 還有多少餘額可以讓你用
  • event Transfer - 轉帳發生後的 Event
  • event Approval - Triggered when approve called


https://theethereum.wiki/w/index.php/ERC20_Token_Standard



基本上現在市面上看到的各種幣有很多都是基於 Ethereum 上的 ERC20 Tokens

沒有留言:

張貼留言