源码分析
创建代币
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的账户余额
网友评论