美文网首页
eosio.token

eosio.token

作者: 遇见你_17be | 来源:发表于2018-12-15 14:10 被阅读0次

源码分析

创建代币

void token::create( account_name issuer,asset        maximum_supply )

设置代币总量

发行代币

void token::issue( account_name to, asset quantity, string memo )

已经发行代币总量+quantity

接收账户代币余额+quantity

交易

void token::transfer( account_name from,account_name to,asset        quantity,string      memo )

发送账户余额-quantity

接收账户余额+quantity

使用eosio.token

cleos create account eosio eosio.token EOS52VT7jeKKP71RWaEcLEhaoSfT86tnVYkrRERXAAuqCZmNjfJke EOS6mnRRwZ26qUe6SbCtJs6ch6aJTvY8X26vKypP4qkHcDmP5BjYU

查询合约账户,并指定密钥

cleos set contract eosio.token /mnt/hgfs/yejn/eos/eos/build/contracts/eosio.token/

部署eosio.token合约

cleos push action eosio.token create '["eosio","1000000000.0000 SYS",0,0,0]' -p eosio.token

创建系统bi币SYS

cleos push action eosio.token issue '["eosio","1000000000.0000 SYS","issue"]' -p eosio

发布币总量,空投

cleos system newaccount eosio inita EOS5VJv4YxPkv9asb5BfSHoDKSVnbuKfay3cNy2kcciELsCdDeqYB EOS6DyXgyTCTydr3GMxg34w7vmCErcWLjzYtvCeNFUyZR9YXCf1Gv --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 8

创建账户,并为账户抵押一定的网络和cpu

cleos push action eosio.token transfer '["eosio", "inita","500000000.0000 SYS","vote"]' -p eosio

从eosio转账给inita一定量的币

cleos get table eosio.token eosio accounts

cleos get table eosio.token inita accounts

查询eosio inita的账户余额

相关文章

网友评论

      本文标题:eosio.token

      本文链接:https://www.haomeiwen.com/subject/biiohqtx.html