前提条件:bancorx交易所合约已部署
/*BancorConverter合约*/
cleos system newaccount --transfer eosio bncrcnvrt11a EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV --stake-net "100.0000 EOS" --stake-cpu "100.0000 EOS" --buy-ram "100.0000 EOS"
/*convert代币合约(eg:BIQRLY)*/
cleos system newaccount --transfer eosio bncrbrly111a EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV --stake-net "100.0000 EOS" --stake-cpu "100.0000 EOS" --buy-ram "100.0000 EOS"
/*BIQ代币合约*/
cleos system newaccount --transfer eosio bncrbtkn111a EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV --stake-net "100.0000 EOS" --stake-cpu "100.0000 EOS" --buy-ram "100.0000 EOS"
cleos set account permission bncrcnvrt11a active '{"threshold": 1,"keys": [{"key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","weight": 1}],"accounts": [{"permission":{"actor":"bncrcnvrt11a","permission":"eosio.code"},"weight":1}]}' owner -p bncrcnvrt11a
cleos set account permission bncrbrly111a active '{"threshold": 1,"keys": [{"key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","weight": 1}],"accounts": [{"permission":{"actor":"bncrbrly111a","permission":"eosio.code"},"weight":1}]}' owner -p bncrbrly111a
cd $HOME/project/bancorx
cleos set contract bncrcnvrt11a ./BancorConverter -p bncrcnvrt11a
cleos set contract bncrbrly111a ./SmartToken -p bncrbrly111a
cleos set contract bncrbtkn111a ./eosio.token -p bncrbtkn111a
发行一千万BIQ代币(10000000 BIQ),和BBNT的初始兑换比例为1000:1
/*BBNT储备金入账*/
cleos push action bnttoken4eos issue '[ "bncrcnvrt11a", "10000.0000 BBNT", "initial" ]' -p bnttoken4eos
/*创建中转代币(BIQRLY)*/
cleos push action bncrbrly111a create '["bncrcnvrt11a", "10000000000.0000 BIQRLY", true]' -p bncrbrly111a
cleos push action bncrbrly111a issue '[ "bncrcnvrt11a", "1000000000.0000 BIQRLY", "initial" ]' -p bncrcnvrt11a
/*创建BIQ代币*/
/*根据需求填入create相关参数*/
cleos push action bncrbtkn111a create '["bncrbtkn111a", "10000000000.0000 BIQ"]' -p bncrbtkn111a
cleos push action bncrbtkn111a issue '[ "bncrcnvrt11a", "10000000.0000 BIQ", "initial" ]' -p bncrbtkn111a
/* 初始化convertor */
cleos push action bncrcnvrt11a create '["bncrbrly111a", "0.0000 BIQRLY", false, true, "bancorxoneos", false]' -p bncrcnvrt11a
cleos get table bncrcnvrt11a bncrcnvrt11a cstate
/* 初始化connectors */
cleos push action bncrcnvrt11a setconnector '[ "bnttoken4eos", "0.0000 BBNT", 500, true,0,"bncrcnvrt11a",0 ]' -p bncrcnvrt11a
cleos push action bncrcnvrt11a setconnector '[ "bncrbtkn111a", "0.0000 BIQ", 500, true,0,"bncrcnvrt11a",0 ]' -p bncrcnvrt11a
cleos get table bncrcnvrt11a bncrcnvrt11a connector
/* register in network*/
cleos push action bancorxoneos regconverter "["bncrcnvrt11a", true]" -p bancorxoneos
cleos get table bancorxoneos bancorxoneos converter
/*注册right token合约*/
cleos push action bancorxoneos regtoken "["bncrbtkn111a", true]" -p bancorxoneos
/*注册convert token合约*/
cleos push action bancorxoneos regtoken "["bncrbrly111a", true]" -p bancorxoneos
cleos get table bancorxoneos bancorxoneos token