新手教程 EOS 是怎么产生最初 10 亿 EOS 的?
yiyanwannian
·
September 23, 2019
·
336 hits
我们知道EOS支持使用eos.token合约发布自定义的token,步骤如下:
- 部署合约:
cleos create account eosio eoasio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
eosio-cpp -I include -o eosio.token.wasm src/eosio.token.cpp --abigen
cleos set contract eosio.token /{yourhomepath}/dev/src/github.com/eosio/eosio.contracts/contracts/eosio.token --abi eosio.token.abi -p eosio.token@active
- 创建自定义的token
cleos push action eosio.token create '[ "alice", "1000000000.0000 SYS"]' -p eosio.token@active
executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles
eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"}
cleos push action eosio.token create '{"issuer":"alice", "maximum_supply":"1000000000.0000 SYS"}' -p eosio.token@active
executed transaction: 0e49a421f6e75f4c5e09dd738a02d3f51bd18a0cf31894f68d335cd70d9c0e12 120 bytes 1000 cycles
eosio.token <= eosio.token::create {"issuer":"eosio","maximum_supply":"1000000000.0000 SYS"}
cleos push action eosio.token issue '[ "alice", "100.0000 SYS", "memo" ]' -p alice@active
executed transaction: 822a607a9196112831ecc2dc14ffb1722634f1749f3ac18b73ffacd41160b019 268 bytes 1000 cycles
eosio.token <= eosio.token::issue {"to":"alice","quantity":"100.0000 SYS","memo":"memo"}
>> issue
eosio.token <= eosio.token::transfer {"from":"eosio","to":"alice","quantity":"100.0000 SYS","memo":"memo"}
>> transfer
eosio <= eosio.token::transfer {"from":"eosio","to":"alice","quantity":"100.0000 SYS","memo":"memo"}
user <= eosio.token::transfer {"from":"eosio","to":"alice","quantity":"100.0000 SYS","memo":"memo"}
cleos push action eosio.token transfer '[ "alice", "bob", "25.0000 SYS", "m" ]' -p alice@active
executed transaction: 06d0a99652c11637230d08a207520bf38066b8817ef7cafaab2f0344aafd7018 268 bytes 1000 cycles
eosio.token <= eosio.token::transfer {"from":"alice","to":"bob","quantity":"25.0000 SYS","memo":"Here you go bob!"}
>> transfer
user <= eosio.token::transfer {"from":"alice","to":"bob","quantity":"25.0000 SYS","memo":"Here you go bob!"}
tester <= eosio.token::transfer {"from":"alice","to":"bob","quantity":"25.0000 SYS","memo":"Here you go bob!"}
cleos get currency balance eosio.token alice SYS
75.00 SYS
cleos get currency balance eosio.token bob SYS
25.00 SYS
可是EOS token是怎么发布的呢? 难道是:
cleos push action eosio.token create '[ "alice", "1000000000.0000 EOS"]' -p eosio.token@active
我在本地做了尝试,发币,转账, 查余额,均无异常,感觉就是这么做的:
去查阅EOS的第一个块(https://bloks.io/block/1):
可以看到transactions节点下并无交易,无法认证上面的做法的正确性!
最后在EOS issue中找到答案(Rename "EOS" symbol in eosio.system to "SYS")[https://github.com/EOSIO/eos/issues/2888] 由此可以确定确实是使用下面的命令行产生的
cleos push action eosio.token create '[ "alice", "1000000000.0000 SYS"]' -p eosio.token@active
当然也可以通过修改eos项目跟目录下的CMakeLists.txt中的 CORE_SYMBOL_NAME 再改回来
if ("${CORE_SYMBOL_NAME}" STREQUAL "")
set( CORE_SYMBOL_NAME "SYS" ) //改成 set( CORE_SYMBOL_NAME "EOS" )
endif()
string(TOUPPER ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME)
No Reply at the moment.