热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

EOS智能合约源代码解读(9)boot合约

1.作用激活protocolfeatures性质activatingdesiredprotocolfeaturespriortodeployingasystemcontract*e



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 keys;
std::vector

accounts;
std::vector 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 one rror( ignore sender_id, ignore> 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 );
}


推荐阅读
  • 本文介绍了P1651题目的描述和要求,以及计算能搭建的塔的最大高度的方法。通过动态规划和状压技术,将问题转化为求解差值的问题,并定义了相应的状态。最终得出了计算最大高度的解法。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文讨论了使用差分约束系统求解House Man跳跃问题的思路与方法。给定一组不同高度,要求从最低点跳跃到最高点,每次跳跃的距离不超过D,并且不能改变给定的顺序。通过建立差分约束系统,将问题转化为图的建立和查询距离的问题。文章详细介绍了建立约束条件的方法,并使用SPFA算法判环并输出结果。同时还讨论了建边方向和跳跃顺序的关系。 ... [详细]
  • 本文介绍了多因子选股模型在实际中的构建步骤,包括风险源分析、因子筛选和体系构建,并进行了模拟实证回测。在风险源分析中,从宏观、行业、公司和特殊因素四个角度分析了影响资产价格的因素。具体包括宏观经济运行和宏经济政策对证券市场的影响,以及行业类型、行业生命周期和行业政策对股票价格的影响。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • ALTERTABLE通过更改、添加、除去列和约束,或者通过启用或禁用约束和触发器来更改表的定义。语法ALTERTABLEtable{[ALTERCOLUMNcolu ... [详细]
  • 本文介绍了一个题目的解法,通过二分答案来解决问题,但困难在于如何进行检查。文章提供了一种逃逸方式,通过移动最慢的宿管来锁门时跑到更居中的位置,从而使所有合格的寝室都居中。文章还提到可以分开判断两边的情况,并使用前缀和的方式来求出在任意时刻能够到达宿管即将锁门的寝室的人数。最后,文章提到可以改成O(n)的直接枚举来解决问题。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
author-avatar
phperint
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有