刘洋
AEX 11 Fungible Token Standard(dratf)
2019-11-17 11:49
阅读:2861

草案完善中,记录下

Interface

contract AEX11Token {
    record meta_info = { name : string
                         symbol : string
                         decimals : int}
    entrypoint meta(): meta_info
    entrypoint total_supply() external : int
    entrypoint balance_of(holder: address) : option(int)

    external default_operators() : list(address)
    external is_operator_for(operator: address, holder: address) : bool
    stateful external authorize_operator(operator: address)
    stateful external revoke_operator(operator: address)

    entrypoint stateful transfer(to: address, amount: int, data: string)
    entrypoint stateful op_transfer(from: address, to: address, amount: int, data: string, op_data: string)

    entrypoint stateful burn(amount: int, data: string)
    entrypoint stateful op_burn(from: address, amount: int, data: string, op_data: string)

    datetype event =
        // operator, from, to, amount ,data, op_data
        Transfer(indexed address,  // operator
                 indexed address,  // from
                 address,          // to
                 int,              // amount
                 string,           // data
                 string)           // op_data
      | Mint(indexed address,  // operator
             indexed address,  // to
             int,              // amount
             string,           // data
             string)           // op_data
      | Burned(indexed address,  // operator
               indexed address,  // from
               int,              // amount
               string,           // data
               string)           // op_data
      | AuthorizedOperator(indexed address,  // operator
                           indexed address)  // holder
      | RevokedOperator(indexed address,  // oprator
                        indexed address)  // holder
}

The token contract MUST implement the above interface. The implementation MUST follow the specifications described below.


来源:https://github.com/aeternity/AEXs/blob/master/AEXS/aex-11.md

转载本文请联系原作者获取授权,同时请注明本文来自刘洋科学网博客。

链接地址:https://wap.sciencenet.cn/blog-1750-1206469.html?mobile=1

收藏

分享到:

当前推荐数:1
推荐人:
推荐到博客首页
网友评论3 条评论
确定删除指定的回复吗?
确定删除本博文吗?