当前位置:首页 » 《随便一记》 » 正文

EOS 智能合约源代码解读 (9)boot合约_thefist11cc的专栏

11 人参与  2022年02月20日 16:32  分类 : 《随便一记》  评论

点击全文阅读


1. 作用

激活 protocol features 性质
activating desired protocol features prior to deploying a system contract

    * eossys.boot is a extremely minimalistic system contract that only supports the native actions and an
    * activate action that allows activating desired protocol features prior to deploying a system contract
    * with more features such as eossys.bios or eossys.system.


  struct permission_level_weight {
      permission_level  permission;
      uint16_t          weight;

      // explicit serialization macro is not necessary, used here only to improve compilation time
      eosLIB_SERIALIZE( permission_level_weight, (permission)(weight) )
   };

   /**
    * Weighted key.
    *
    * @details A weighted key is defined by a public key and an associated weight.
    */
   struct key_weight {
      eossys::public_key  key;
      uint16_t           weight;

      // explicit serialization macro is not necessary, used here only to improve compilation time
      eosLIB_SERIALIZE( key_weight, (key)(weight) )
   };

   /**
    * Wait weight.
    *
    * @details A wait weight is defined by a number of seconds to wait for and a weight.
    */
   struct wait_weight {
      uint32_t           wait_sec;
      uint16_t           weight;

      // explicit serialization macro is not necessary, used here only to improve compilation time
      eosLIB_SERIALIZE( wait_weight, (wait_sec)(weight) )
   };

   /**
    * Blockchain authority.
    *
    * @details An authority is defined by:
    * - a vector of key_weights (a key_weight is a public key plus a weight),
    * - a vector of permission_level_weights, (a permission_level is an account name plus a permission name)
    * - a vector of wait_weights (a wait_weight is defined by a number of seconds to wait and a weight)
    * - a threshold value
    */
   struct authority {
      uint32_t                              threshold = 0;
      std::vector<key_weight>               keys;
      std::vector<permission_level_weight>  accounts;
      std::vector<wait_weight>              waits;

      // explicit serialization macro is not necessary, used here only to improve compilation time
      eosLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) )
   };

   /**
    * @defgroup eossysboot eossys.boot
    * @ingroup eossyscontracts
    *
    * eossys.boot is a extremely minimalistic system contract that only supports the native actions and an
    * activate action that allows activating desired protocol features prior to deploying a system contract
    * with more features such as eossys.bios or eossys.system.
    *
    * @{
    */
   class [[eossys::contract("eossys.boot")]] boot : public eossys::contract {
      public:
         using contract::contract;

 /**
          * On error action.
          *
          * @details Notification of this action is delivered to the sender of a deferred transaction
          * when an objective error occurs while executing the deferred transaction.
          * This action is not meant to be called directly.
          *
          * @param sender_id - the id for the deferred transaction chosen by the sender,
          * @param sent_trx - the deferred transaction that failed.
          */
         [[eossys::action]]
         void onerror( ignore<uint128_t> sender_id, ignore<std::vector<char>> sent_trx );

         /**
          * Activates a protocol feature.
          *
          * @details Activates a protocol feature
          *
          * @param feature_digest - hash of the protocol feature to activate.
          */
         [[eossys::action]]
         void activate( const eossys::checksum256& feature_digest );

         /**
          * Asserts that a protocol feature has been activated.
          *
          * @details Asserts that a protocol feature has been activated
          *
          * @param feature_digest - hash of the protocol feature to check for activation.
          */
         [[eossys::action]]
         void reqactivated( const eossys::checksum256& feature_digest );
}




点击全文阅读


本文链接:http://m.zhangshiyu.com/post/35045.html

激活  性质  作用  
<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 花开花落再无你我小说(方柠赵景行)全文+后续(花开花落再无你我)无套路阅读
  • 全文高考当天,我放任校花调转送考大巴带全班救首富精选作品(周清清傅煜许曦)列表_全文高考当天,我放任校花调转送考大巴带全班救首富精选作品
  • 全书浏览最终还是失去你免费(苏棠月靳延)_最终还是失去你免费(苏棠月靳延)全书结局
  • 如果眼睛看得到在线阅读_沈明初小昭高希希阅读_小说后续在线阅读_无删减免费完结_
  • 元婴归来我在都市当学霸仙尊全书苏北林风在线
  • 谢承钧小说整本+后续(穿成佛子的恶毒后妈)清爽版阅读
  • 你惹她干啥她疯起来嘎乱杀结局+番外+完结(楚瑶)全书浏览_你惹她干啥她疯起来嘎乱杀结局+番外+完结全书浏览
  • 清冷逆徒动情后,反派师尊被缠哭(洛凝墨寒砚)_清冷逆徒动情后,反派师尊被缠哭
  • 高考分数出来那天,全家哭着求我原谅后续+番外_何思涵妹妹何思墨未删减_小说后续在线阅读_无删减免费完结_
  • 婚礼前夜未婚夫喂我安眠药,只为让养妹当新娘独家番外_许绍宁养妹全文_小说后续在线阅读_无删减免费完结_
  • 以身入局,我要掀翻这座城的天结局+番外+续集(程少云阮朵)_以身入局,我要掀翻这座城的天结局+番外+续集(程少云阮朵)
  • 出狱后,真千金手撕白莲杀疯了全文免费阅读无弹窗大结局_秦季姜沁最新章节列表_笔趣阁(出狱后,真千金手撕白莲杀疯了:完结+结局+番外)

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1