EOS的NFTs实现方案

1
https://github.com/MythicalGames/dgoods/

https://github.com/MythicalGames/dgoods/blob/master/dGoods%E5%8D%8F%E8%AE%AE%E4%B8%AD%E6%96%87%E7%89%88.pdf 《dGoods协议中文版.pdf》
提出人是游戏公司Mythical Games(Jan 7, 2019),

1 CREATE : create 函数将实例化一个代币。它是在任何代币进行发行前,或者设置
诸如代币类别、名字、最大供应量、谁有权限进行发行代币,是否是非同质化的等
等属性前,必须执行的一个方法。此外,第一次调用该方法时,代币符号会被记
录,并且在后续调用时,必须指定改符号。符号必须是大写 A-Z 组成,请最长为
7 位字符。Name 类型是一个 a-z, 1-5 组成的最长 12 位字符的字符串。


ACTION create(name issuer, string symbol, name category, name
token_name, bool fungible, bool burnable, bool transferable, int64_t
max_supply);
—————————————————————————————————
2 ISSUE : issue 函数可以发行一个代币,并且将所有权指定给账户名’to’. 对于一
个有效的函数调用,代币的符号、类别、名字都必须都先被创建好了。如果是非同
质化或半同质化的代币,则数量必须等于 1,如果是同质化代币,则数量必须是大
于等于 0.0001

ACTION issue(name to, string symbol, name category, name token_name,
double quantity, string metadata_uri, string memo);
—————————————————————————————————
3 PAUSEXFER : 暂停所有代币的所有转账,仅有合约可以调用该函数。如果 pause
参数值为 true,则暂停转账;否则,不暂停。


ACTION pausexfer(bool pause);
—————————————————————————————————
4 BURNNFT : 该函数可用于销毁第三方代币并且释放内存,只有代币的拥有者
(owner) 可以调用该方法,并且 burnable 参数值必须为 true


ACTION burnnft(name owner, vector<uint64_t> tokeninfo_ids);
—————————————————————————————————
5 BURN : 该方法用于销毁同质化代币,并且在所有代币都销毁后释放内存
(RAM),只有拥有者 (owner) 可以调用该方法,并且 burnable 参数值必须为true

ACTION burn(name owner, uint64_t global_id, double quantity);
—————————————————————————————————
6 TRANSFERNFT : 用于非同质化代币的转账。并且允许通过传递代币的 id 列表进
行批量转账。仅有代币拥有者 (owner) 可以调用改函数并且 transferable 参数值
必须为 true。


ACTION transfernft(name from, name to, vector<uint64_t> tokeninfo_ids,
string memo);
—————————————————————————————————
7 TRANSFER : 该标准的转账方法仅用于同质化代币;区别于将每个代币都一一区
分,这里转账的代币由一个 global_id 进行区分,并且后面跟着希望发送的代币数
量。

ACTION transfer(name from, name to, uint64_t global_id, double quantity);

2 https://github.com/cryptolions/SimpleAssets

https://medium.com/@cryptolions/eosio%E5%8C%BA%E5%9D%97%E9%93%BE%E6%95%B0%E5%AD%97%E4%BA%A7%E5%93%81-simple-assets-alpha-%E7%AE%80%E4%BB%8B-71e26d4cbb71
《EOSIO区块链数字产品 “Simple Assets”(Alpha)简介》

2019 CryptoLions提出(Feb 24, 2019),已有公司站队,提出者CryptoLions也是eos节点之一。

ACTION

 # -- For Non-Fungible Tokens ---
 
 create          (author, category, owner, idata, mdata, requireсlaim)  
 update          (author, owner, assetid, mdata)  
 transfer        (from, to , [assetid1,..,assetidn], memo)  
 burn            (owner, [assetid1,..,assetidn], memo)  
 
 offer           (owner, newowner, [assetid1,..,assetidn])  
 canceloffer     (owner, [assetid1,..,assetidn])  
 claim           (claimer, [assetid1,..,assetidn])  
  
 regauthor       (name author, data, stemplate)  
 authorupdate    (author, data, stemplate)  
 
 delegate        (owner, to, [assetid1,..,assetidn], untildate)  
 undelegate      (owner, from, [assetid1,..,assetidn])  
 
 
 # -- For Fungible Tokens ---
 
 createf         (author, maximum_supply, authorctrl)
 issuef          (to, author, quantity, memo)
 transferf       (from, to, author, quantity, memo)
 burnf           (from, author, quantity, memo)

 openf           (owner, author, symbol, ram_payer)
 closef          (owner, author, symbol)

3 https://github.com/unicoeos/eosio.nft

简评:unicoeos公司搞的,提出时间比较早( 21 May 2018),但更新比较慢。看来没有成为标准的希望。

ACTION

    /// Creates token with a symbol name for the specified issuer account.
    /// Throws if token with specified symbol already exists.
    /// @param issuer Account name of the token issuer
    /// @param symbol Symbol code of the token
        ACTION create(name issuer, std::string symbol);

    /// Issues specified number of tokens with previously created symbol to the account name "to". 
    /// Each token is generated with an unique token_id assigned to it. Requires authorization from the issuer.
    /// Any number of tokens can be issued.
    /// @param to Account name of tokens receiver
    /// @param quantity Number of tokens to issue for specified symbol (positive integer number)
    /// @param uris Vector of URIs for each issued token (size is equal to tokens number)
    /// @param name Name of issued tokens (max. 32 bytes)
    /// @param memo Action memo (max. 256 bytes)
        ACTION issue(name to,
                   asset quantity,
                   vector<string> uris,
           string name,
                   string memo);

    /// Transfers 1 token with specified "id" from account "from" to account "to".
    /// Throws if token with specified "id" does not exist, or "from" is not the token owner.
    /// @param from Account name of token owner
    /// @param to Account name of token receiver
    /// @param id Unique ID of the token to transfer
    /// @param memo Action memo (max. 256 bytes)
        ACTION transferid(name from,
                      name to,
                      id_type id,
                      string memo);

    /// Transfers 1 token with specified symbol in asset from account "from" to account "to".
    /// Throws if amount is not 1, token with specified symbol does not exist, or "from" is not the token owner.
    /// @param from Account name of token owner
    /// @param to Account name of token receiver
    /// @param quantity Asset with 1 token 
    /// @param memo Action memo (max. 256 bytes)
    ACTION transfer(name from,
                      name to,
                      asset quantity,
                      string memo);

    /// @notice Burns 1 token with specified "id" owned by account name "owner".
    /// @param owner Account name of token owner
    /// @param id Unique ID of the token to burn
    ACTION burn(name owner,
                  id_type token_id);

    /// @notice Sets owner of the token as a ram payer for stored data.
    /// @param payer Account name of token owner
    /// @param id Unique ID of the token to burn
        ACTION setrampayer(name payer, 
               id_type id);
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,015评论 4 362
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,262评论 1 292
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,727评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,986评论 0 205
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,363评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,610评论 1 219
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,871评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,582评论 0 198
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,297评论 1 242
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,551评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,053评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,385评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,035评论 3 236
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,079评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,841评论 0 195
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,648评论 2 274
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,550评论 2 270