开发笔记2



第二节  部署贸易币合约
(1)不同于代币,贸易币合约提供了储蓄,提款、借贷、收款等接口,可以和esio.token合约对比,esio.token只是提供了创建代币、发行代币和转账几个接口
         void createx( account_name    creator,
                       asset           initial_supply,
                       uint32_t        fee,
                       extended_asset  base_deposit,
                       extended_asset  quote_deposit
                     );


         void deposit( account_name from, extended_asset quantity );
         void withdraw( account_name  from, extended_asset quantity );
         void lend( account_name lender, symbol_type market, extended_asset quantity );


         void unlend(
            account_name     lender,
            symbol_type      market,
            double           interest_shares,
            extended_symbol  interest_symbol
         );


(2)创建一个贸易币账户
  cleos create account eosio exchange EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
(3)部署贸易币合约
ubuntu@ubuntu:~/coding/eos/build/programs/cleos$ cleos set contract exchange ../../contracts/exchange -p exchange
Reading WAST/WASM from ../../contracts/exchange/exchange.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: 6785f85e6102fc086ff271676215ffab2d8191d1168879c6388fff3b2ed59f62  25480 bytes  3488 us
#         eosio <= eosio::setcode               {"account":"exchange","vmtype":0,"vmversion":0,"code":"0061736d0100000001a1022b60067f7e7f7f7f7f00600...
#         eosio <= eosio::setabi                {"account":"exchange","abi":"0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d650e0...
warning: transaction executed locally, but may not be confirmed by the network yet




第三节 部署Eosio.msig合约
(1)这个合约主要用于多重签名。它提供了多个参与方异步签名的接口。查看源码其大致接口如下:


         void propose();  //提议
         void approve( account_name proposer, name proposal_name, permission_level level );  //批准
         void unapprove( account_name proposer, name proposal_name, permission_level level );  // 拒绝
         void cancel( account_name proposer, name proposal_name, account_name canceler );  // 取消
         void exec( account_name proposer, name proposal_name, account_name executer );  //执行






(2)创建账户
cleos create account eosio eosio.msig EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV


(3)部署合约
cleos set contract eosio.msig build/contracts/eosio.msig -p eosio.msig
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值