一起来读源码69-eosio.contracts eosio.system

摘要

eos的投票以及资产购买,抵押,竞拍,出租,等等;
购买机制使用的bancor算法;
执行action需要ram,cpu和net,cpu和net需要抵押获得,ram需要购买;用来抵押的物品为eos token;
ram会消耗;cpu和net用完会退押金;

详情

eosio.system.hpp
exchange_state.hpp
native.hpp
rex.results.hpp
delegate_bandwidth.cpp
eosio.system.cpp
exchange_state.cpp
name_bindding.cpp
native.cpp
producer_pay.cpp
rex.cpp
rex.results.cpp
voting.cpp

知识点

  • std::enable_if是c++15支持的写法,c++11为std::enable_if;当enable_if的条件为true时,优先匹配enable_if后面的模板;enable_if_t是enable_if的type;
  • std::optional类似于智能指针接口,可以显示转化为bool类标识std::optional是否有一个值;
  • std::is_same 判断类型是否一致,位于头文件<type_traits>中,两个一样的类型会返回true;
  • 1000’000ll 表示把int型的1000000转为long long型;

投票

  1. 投票前需要抵押eos换取cpu和net,调用delegatebw抵押eos;
  2. 账号需要调用regproducer注册成为生产者节点候选人,别的账号才能给他投票;
  3. 账号可以调用voteproducer给其他账号投票;
  4. 如果不想投票,调用undelegatebw取消抵押,但是要3天才能到帐;
  5. 投票计分,账号的投票权重与抵押的eos数量正相关;具体的规则看代码;

抵押与投票权重转换规则: 权 重 = 抵 押 的 资 金 × ( 2 ( 自 2000 年 来 的 周 数 ) ÷ 52 ) 权重=抵押的资金\times(2^{(自2000年来的周数)\div52}) =×(2(2000)÷52)

购买/出售资源

  1. 内存无法抵押获得,只能获得;
  2. 购买(buyram)或出售(sellram)内存需要收取:0.5%的小费,也就是说完成一次交易需要买卖双方总共需要支付1%的小费;

交易所规则

  • 外部转交易所: 实 际 可 购 买 数 量 = 预 定 数 量 × [ ( 1 + 支 付 金 额 ÷ 供 应 量 ) 小 费 − 1 ] 实际可购买数量=预定数量\times[(1+支付金额\div供应量)^{小费} -1] =×[(1+÷)1]
  • 交易所转外部: 实 际 可 购 买 数 量 = 预 定 数 量 × [ 1 + 支 付 金 额 ÷ 供 应 量 小 费 − 1 ] 实际可购买数量=预定数量\times[\sqrt[小费]{1+支付金额\div供应量}-1] =×[1+÷ 1]

名字竞拍

竞拍规则:

  1. 如果没人抢,直接给竞拍者;
  2. 如果有人抢, 出钱多的放到竞拍表,出钱少的放到竞拍退钱表里;

生产块

  1. 每分钟更新块生产者一次;
  2. 在生产区块时,出现冲突,先找到eosio_global_state全局变量表的last_producer_schedule_update(最后一个块生成时间)做比对;

领奖

  1. 出块有奖励,限制一天只能领取一次;
  2. 出块资金分成两部分:一部分给节点,另一部分给eosio.saving;
  3. 具体规则看代码

名字规则

  1. 账号格式:12个字符长,包含:".", 1~9, a~z;
  2. 如果名字中间含有"."",则".”后面必须为创建者名字;比如 abc.def 的创建者是 def

定义内联函数

//域是否存在, 如果标记F是无符号整型 且 域E是枚举无符号整型
template<typename ER, typename F>
static inline auto has_field( F flag, E field )
-> std::enable_if_t< std::is_integral_v<F> && std::is_unsigned_v<F> &&
					 std::is_enum_v<E> && std::is_same_v< F, std::underlying_type_t<E> >, bool >
{
	return ( (flags & static_cast<F>(field)) != 0 );//静态转换ok
}
//设置域(bool)
template<typename E, typename F>
static inline auto set_field( F flags, E field, bool value = true )
-> std::enable_if_t< std::is_integral_v<F> && std::is_unsigned_v<F> &&
					 std::is_enum_v<E> && std::is_same_v< F, std::underlying_type_t<E> >, F >
{
	if( value )
		return ( flags | static_cast<F>(field) ); 
	else
		return ( flags & ~static_cast<F>(field) );
}

定义全局变量

名字类型说明
seconds_per_yearstatic constexpr uint32_t52724*3600, 每一年的秒数
seconds_per_daystatic constexpr uint32_t24*3600, 每天的秒数
seconds_per_hourstatic constexpr uint32_t3600, 每小时的秒数
useconds_per_yearstatic constexpr int64_tint64_t(seconds_per_year) * 1000’ 000ll, 每年的微秒数
useconds_per_daystatic constexpr int64_tint64_t(seconds_per_day) * 1000’ 000ll, 每天的微秒数
useconds_per_hourstatic constexpr int64_tint64_t(seconds_per_hour) * 1000’ 000ll, 每小时的微秒数
blocks_per_daystatic constexpr uint32_t2*seconds_per_day, 1秒钟产生2个块
min_activated_stakestatic constexpr int64_t150’000’000’0000, 最小活跃抵押,更新投票时用
ram_gift_bytesstatic constexpr int64_t1400, 内存数据包大小
min_pervote_daily_paystatic constexpr int64_t100’0000, 最小日级平均投票
refund_delay_secstatic constexpr uint32_t3 * seconds_per_day, 资金返还延时,3天
inflation_percisionstatic constexpr int64_t100, 通胀系数,2个小数点
default_annual_ratestatic constexpr int64_t500, 默认年利率
pay_factor_percisionstatic constexpr int64_t10000, ?
default_inflation_pay_factorstatic constexpr int64_t50000, 默认通胀倍数
default_votepay_factorstatic constexpr int64_t40000, 默认投票倍数

定义action

接口参数说明
initunsigned_init:版本, const symbol&:系统货币初始化
onblockignore<block_header>:块头更新块
setalimitsconst name& 账号, int64_t 内存字节大小, int64_t 网络资源, int64_t cpu资源设置账号资源限制
setacctramconst name& 账号, const std::optional<int64_t>& 内存限制设置内存限制
setacctnetconst name& 账号, const std::optional<int64_t>& 网络限制设置网络限制
setacctcpuconst name& 账号, const std::optional<int64_t>& cpu限制设置cpu限制
activateconst eosio::checksum256& 特征摘要激活协议
delegatebwconst name& 抵押者, const name&:token 接收者, const asset& 获得的网络, const asset& 获得的cpu, bool 是否发生交易抵押token,获取net和cpu
setrexconst asset& 数量设置资源代币数量
depositconst name& 用户, const asset&:数量交定金
withdrawconst name& 资金拥有者, const asset& 资金数量从资金池撤回资产
buyrexconst name& 购买者, const asset& 资金数量购买资源代币
unstaketorexconst name& 退货人, const name& 接受者, const asset& 网络, const asset& cpu取消抵押资源代币并退钱
sellrexconst name& 出售者, const asset& 资金数量出售资源代币
cnclrexorderconst name& 调用人取消资源代币订单
rentcpuconst name& 出租者, const name& 接收者, const asset& 出租花费, const asset& 出租退费出租cpu
rentnetconst name& 出租者, const name& 接收者, const asset& 出租花费, const asset& 出租退费出租网络
fundcpuloanconst name& 出租者, uint64_t 出租数量, const asset& 花费cpu出租打钱
fundnetloanconst name& 出租者, uint64_t 出租数量, const asset& 花费net出租打钱
defcpuloanconst name& 出租者, uint64_t 出租数量, const asset& 价格定义cpu出租价格
defnetloanconst name& 出租者, uint64_t 出租数量, const asset& 价格定义net出租价格
updaterexconst name& 用户更新用户资源代币
rexexecconst name& 用户, uint16_t 最大订单数处理cpu,net,rex出租订单
consolidateconst name& 收款人应付款到期合并
mvtosavingsconst name& 收款人, const asset& 金额删除应付款
mvfrsavingsconst name& 收款人, const asset& 金额添加应付款
closerexconst name& 持有人删除代币
undelegatebwconst name& 押金持有人, const name& 押金抵押者, const asset& 抵押的net, const asset& 抵押的cpu取消抵押
buyramconst name& 买家, const name& 卖家, const asset& 内存数量购买内存
buyrambytesconst name& 买家, const name& 卖家, uint32_t 字节数购买指定大小内存,使用的bancor算法,内存与资金的兑换比率浮动变化;收0.5%的小费
sellramconst name& 卖家, int64_t 内存大小出售内存,需要0.5%的小费
refundconst name& 收款人退款,有3天的延时
regproducerconst name& 节点, const public_key& 节点公钥, const std::string& 节点地址, uint16_t 所属国家注册节点
regproducer2const name& 节点, const eosio::block_signing_authority& 权限, const std::string& 地址, uint16_t 所属国家注册节点2
unregprodconst name& 生产者名字取消注册生产者
setramuint64_t 内存大小设置提供的内存大小
setramrateuint16_t 每个块的内存大小设置每个块内存增长速率,影响内存供应
voteproducerconst name& 投票人, const name& 账户代理人, const std::vector& 节点集合投票生产者节点,可以投给多人
regproxyconst name& 代理人, bool 是否使用了代理注册代理人,已经使用了代理的投票者不能注册未投票代理
setparamsconst eosio::blockchain_parameters& 参数设置系统参数
claimrewardsconst name& 节点节点领奖
setprivconst name& 账号, uint8_t 是否开启特权设置特权开启,0不开,>0开启
rmvproducerconst name& 节点让一节点失效
updtrevisionuint8_t 新的版本更新版本
bidnameconst name& 竞拍者, const name& 新名字, const asset& 竞拍资金竞拍抢名字
bidrefundconst name& 竞拍者, const name& 新名字竞拍退款
newaccountconst name& 创建者, const name& 要创建的名字, ignore owner权限, ignore active权限新建账号;1.账号格式:12个字符长,不包含"."; 2.新账号创建时必须购买一个最小单位的内存
updateauthignore 账号, ignore 权限, ignore 账号的父账号,调用次action的人, ignore 此action的调用权限更新账号的权限
deleteauthignore 账号, ignore 权限删除权限
linkauthignore 调用者账号, ignore 被授权人, ignore 被赋值的action, ignore权限给一个action赋予权限,有5个action: updateauth, deleteauth, linkauth, unlinkauth, canceldelay;不能被赋权
unlinkauthignore 调用者账号, ignore 被授权人, ignore被取消的action 取消授权
canceldelayignore<permission_level> 权限, ignore 传输id取消延时传输
onerrorignore<uint128_t> 发送者, ignore<std::vector> 传输id报错
setabiconst name& 账号, const std::vector& abi设置合约abi
setcodeconst name& 部署者, uint8_t 虚拟机类型, uint8_t 虚拟机版本, const std::vector& 合约内容设置合约
setinflationint64_t 年率, int64_t 通胀系数, int64_t 投票系数设置通胀率

定义私有函数

函数参数说明
static symbol get_core_symbolconst rammarket& rm:交易所返回ram交易所的货币类型
static eosio_global_state get_default_parameters-返回默认的全局变量表
static eosio_blobal_state4 get_default_inflation_parameters-返回默认的全局变量表4的信息
symbol core_symbol()const-返回货币类型
void update_ram_supply-更新ram供应量
void runrexuint16_t max:3种资源的最大数量(net, cpu, 代币出售订单执行代币动作(买net,买cpu,出售代币…)
void update_rex_pool-更新代币池
void update_resource_limitsconst name& from: 记账人, const name& receiver:需要变更者, int64_t delta_net:net资源, int64_t delta_cpu:cpu资源更新账号资源限制
void check_voting_requirementconst name& owner:代币持有者, const char* error_msg:返回错误是否可以买代币,只有生产者大于21个或它是一个代理才可以买代币;
rex_order_outcome fill_rex_orderconst rex_balance_table::const_iterator& bitr:迭代器, const asset& rex:代币撮合代币订单
asset update_rex_accountconst name& owner:账号, const asset& proceeds:转到个人代币表的数量, const asset& delta_stake 抵押的数目(用来增加权重), bool force_vote_update:是否强制更新投票权)更新账号代币
void channel_to_rexconst name& from:转账者, const asset& amount 数量代币渠道转账
void channel_namebid_to_rexconst int64_t highest_bid:最高出价账号竞拍代币转账
template int64_t rent_rexT& table 记录表, const name& from 出租人, const name& receiver 购买者, const asset& loan_payment 小费, const asset& loan_fund 出租的代币资产出租代币
template void fund_rex_loanT& table 记录表, const name& from 借出人, uint64_t loan_num 借出数目, const asset& payment 小费出借代币
void defund_rex_loanT& table 记录表, const name& from 借款人, uint64_t loan_num 借出资金数目, const asset& amount 借出的资金收回借出的代币
void transfer_from_fundconst name& owner 拥有者, const asset& amount 资金从代币资金表转资金出来
void transfer_to_fundconst name& owner 拥有者, const asset& amount 资金将资金转入代币资金表
bool rex_loans_available()const-是否可以借贷代币,如果代币池有效且没有订单或订单已结束,返回true
bool rex_system_initialized()const { return _rexpool.begin() != _rexpool.end(); }-代币系统是否已经初始化
bool rex_available()const { return rex_system_initialized() && _rexpool.begin()->total_rex.amount > 0; }-代币池是否有代币
static time_point_sec get_rex_maturity-计算购买代币4天后到期时间的秒数
asset add_to_rex_balanceconst name& owner 代币所有者, const asset& payment 小费, const asset& rex_received 购买的代币添加代币到代币现金表,返回所有抵押的代币数量
asset add_to_rex_poolconst asset& payment 代币添加代币到代币池,比率:10000, 代币池代币总额为:200000000
void add_to_rex_return_poolconst asset& fee 代币添加代币到代币返还表
void process_rex_maturitiesconst rex_balance_table::const_iterator& bitr 迭代器更新代币已到期的桶
void consolidate_rex_balanceconst rex_balance_table::const_iterator& bitr 桶迭代器, const asset& rex_in_sell_order 正在出售的代币订单把所有代币到期桶合并到一个桶(排除掉正在出售的代币)
int64_t read_rex_savingsconst rex_balance_table::const_iterator& bitr 代币桶迭代器取一个正在存储的桶
void put_rex_savingsconst rex_balance_table::const_iterator& bitr 迭代器, int64_t rex 待添加的代币数量放一个详细的代币数量到过期桶里面去
void update_rex_stakeconst name& voter 投票人更新投票人代币抵押
void add_loan_to_rex_poolconst asset& payment 本次借贷的小费, int64_t rented_tokens 借贷人抵押的token, bool new_loan 是否是新的订单创建新的借贷或激活旧的订单
void remove_loan_from_rex_poolconst rex_loan& loan 借贷记录从代币池表移除指定借贷记录
template <typename Index, typename Iterator> int64_t update_renewed_loanIndex& idx 索引, const Iterator& itr 迭代器, int64_t rented_tokens 出租的token更新订单
void changebwname from 变更者, const name& receiver 接收者, const asset& stake_net_quantity 抵押的net数量, const asset& stake_cpu_quantity 抵押的cpu数量, bool transfer变更带宽
void update_voting_powerconst name& voter 投票人, const asset& total_update 投票权变更值更新投票权
void register_producerconst name& producer 生产者, const eosio::block_signing_authority& producer_authority 生产者签名验证, const std::string& url 生产者地址, uint16_t location 生产者所属国家注册成为生产者
void update_elected_producersconst block_timestamp& timestamp 更新的时间更新生产者选举
void update_votesconst name& voter 投票人, const name& proxy 代理人, const std::vector& producers 生产者, bool voting 是否在投票中更新投票信息
void propagate_weight_changeconst voter_info& voter 投票人传播投票变更
double update_producer_votepay_shareconst producers_table2::const_iterator& prod_itr , const time_point& ct , double shares_rate , bool reset_to_zero更新生产者投票股份
double update_total_votepay_shareconst time_point& ct, double additional_shares_delta , double shares_rate_delta更新总投票股份

定义table

name_bid 名字竞拍表
类型名字注释
namenewname新的名字
namehigh_bidder最高出价者
int64_thigh_bid价格
time_pointlast_bid_time最后一次出价时间
funcprimary_key主键
funcby_high_bid分索引
bid_refund 竞拍退款表
类型名字注释
namebidder竞拍者
assetamount资产
eosio_global_state 全局变量表
类型名字注释
uint64_tmax_ram_size最大内存大小 64GB
uint64_ttotal_ram_bytes_reserved = 0可用内存大小
int64_ttotal_ram_stake = 0总内存抵押大小
block_timestamplast_producer_schedule_update最后一个块生成时间
time_pointlast_pervote_bucket_fill最后一次投入桶时间
int64_tpervote_bucket = 0每次投票的奖励
int64_tperblock_bucket = 0每次出块的奖励
uint32_ttotal_unpaid_blocks = 0总未支付的块
int64_ttotal_activated_stake = 0总有效的抵押
time_pointthresh_activated_stake_time上次更新抵押的时间
uint16_tlast_producer_schedule_size上一个生产者调度任务大小
doubletotal_producer_vote_weight生产者的投票权重
block_timestamplast_name_close上次出块时间
funcuint64_t free_ram()const { return max_ram_size - total_ram_bytes_reserved; }释放内存
eosio_global_state2 全局变量表2
类型名字注释
uint16_tnew_ram_per_block= 0每个块分配内存
block_timestamplast_ram_increase上一次内存增长时间
block_timestamplast_block_num上次出块时间(不建议使用)
doubletotal_producer_votepay_share = 0总生产者投票股份
uint8_trevision = 0修订后的版本号, 最大256
eosio_global_state3 全局变量表3
类型名字注释
time_pointlast_vpay_state_update上一次投票状态更新时间
doubletotal_vpay_share_change_rate = 0总投票权重变更速率
eosio_global_state4 全局变量表4
类型名字注释
doublecontinuous_rate持续率
int64_tinflation_pay_factor通胀倍数
int64_tvotepay_factor投票倍数
producer_info 生产者信息表
类型名字注释
nameowner生产者名字
doubletotal_votes = 0总投票数
eosio::public_keyproducer_key生产者key
boolis_active = true是否活跃
std::stringurl网址
uint32_tunpaid_blocks = 0未支付的块数量
time_pointlast_claim_time上一次领取时间
uint16_tlocation = 0所属地区
eosio::binary_extensioneosio::block_signing_authorityproducer_authority生产者权限验证
producer_info2 生产者信息表2
类型名字注释
nameowner生产者名字
doublevotepay_share = 0投票股份
time_pointlast_votepay_share_update上一次投票股份变更时间
funcuint64_t primary_key()const { return owner.value }主键
voter_info 投票者信息表
类型名字注释
nameowner投票人
nameproxy代理人
std::vectorproducers生产者集合
int64_tstaked = 0抵押的token数量
doublelast_vote_weight = 0上一次投票资产
doubleproxied_vote_weight = 0代理人投票区资产
boolis_proxy = 0是否是代理人
uint32_tflags1 = 0标记 ram:1 net:2 cpu:4
uint32_treserved2 = 0(无用)
eosio:assetreserved3(无用)
user_resources 用户资源表
类型名字注释
nameowner拥有者
assetnet_weight网络资产
assetcpu_weightcpu资产
int64_tram_bytes内存大小
funcbool is_empty()const { return net_weight.amount == 0 && cpu_weight.amount == 0 && ram_bytes == 0; }net,cpu和ram是否都为空
funcuint64_t primary_key()const { return owner.value; }主键
delegated_bandwidth 带宽委托表
类型名字注释
namefrom发起者
nameto接收者
assetnet_weightnet资产
assetcpu_weightcpu资产
funcbool is_empty()const { return net_weight.amount == 0 && cpu_weight.amount == 0; }是否网络和cpu资源为空
funcuint64_t primary_key()const { return to.value; }主键
refund_request 请求退款表
类型名字注释
nameowner拥有者名字
time_point_secrequest_time请求时间
eosio::assetnet_amount网络资产
eosio::assetcpu_amountcpu资产
rex_pool 代币池表
类型名字注释
uint8_tversion版本
assettotal_lent所有已借出资产
assettotal_unlent所有未借出资产
assettotal_rent租金
assettotal_lendable所有代币,已借出资产+未借出资产
assettotal_rexrex总额
assetnamebid_proceeds名字竞拍者出资
uint64_tloan_num贷款数量
rex_return_pool 代币退还池表
类型名字注释
uint8_tversion版本
time_point_seclast_dist_time最后一次返还资金时间
time_point_secpending_bucket_time0xffffffff 秒,12小时,资金返还桶装满时间
time_point_secoldest_bucket_time0, 12小时,最老的资金返还桶时间
int64_tpending_bucket_proceeds0,等待处理的桶子数
int64_tcurrent_rate_of_increase0, 过期速率
int64_tproceeds0, 已处理
static constexpr uint32_ttotal_intervals30 * 144 = 30天,最大时长
static constexpr uint32_tdist_interval10 * 60, 10分钟
static constexpr uint8_thours_per_bucket12, 每个桶子的时长
rex_fund 代币资金表
类型名字注释
uint8_tversion版本
nameowner代币拥有者
assetbalance代币数量
funcuint64_t primary_key()const { return owner.value; }主键
rex_return_buckets 代币进项积累表
类型名字注释
uint8_tversion版本
std::map<time_point_sec, int64_t>return_buckets12小时内进项桶
funcuint64_t primary_key()const{return 0;}主键
rex_balance 代币现金表
类型名字注释
uint8_tversion0, 版本
nameownerrex现金持有者
assetvote_stake投票股份
assetrex_balanceREX现金数量
int64_tmatured_rex可出售的rex
std::deque<std::pair<time_point_sec, int64_t>>rex_maturities代币每天出售的桶队列
funcuint64_t primary_key()const { return owner.value; }主键
rex_loan 代币出租表
类型名字注释
uint8_tversion0, 版本
namefrom出租者
namereceiver租户
assetpayment支付的SYS tokens
assetbalance可用来续租的SYS tokens
assettotal_staked押金
uint64_tloan_num出租的rex数量
eosio::time_pointexpiration交易过期时间
funcuint64_t primary_key()cosnt { return loan_num; }主键
funcuint64_t by_expr()const { return expiration.elapsed.count(); }分索引1
funcuint64_t by_owner()const { return from.value }分索引2
rex_order 代币订单表
类型名字注释
uint8_tversion0, 版本
nameowner持有者
assetrex_requested请求的代币数量
assetproceeds订单数量
assetstake_change押金数量
eosio::time_pointorder_time订单创建时间
boolis_opentrue, 订单是否有效
funcvoid close() {is_open = false;}关闭订单
funcuint64_t primary_key() const {return owner.value}主键
funcuint64_t by_time()const {return is_open ? order_time.elapsed.count() : std::numeric_limits<uint64_t>::max();}分索引
//代币订单处理结果
struct rex_order_outcome {
	bool success; 		//是否成功
	asset proceeds; 	//处理的数量
	asset stake_change; //抵押变更
};
abi_hash abi表
类型名字注释
nameowner拥有者
checksum256hashhash
exchange_state 交易所
struct connector {
    asset balance,      //储备金余额
    double weight = 5,  //小费
}
类型名字注释
assetsupply供应量
connectorbase原价
connectorquote出价
funcuint64_t primary_key()const { return supply.symbol.raw(); }主键
funcasset convert_to_exchange( connector& reserve, const asset& payment)reserve:预定量,payment:支付金额,; 转成交易所价格; 实 际 可 购 买 数 量 = 预 定 数 量 × [ ( 1 + 支 付 金 额 ÷ 供 应 量 ) 小 费 − 1 ] 实际可购买数量=预定数量\times[(1+支付金额\div供应量)^{小费} -1] =×[(1+÷)1]
funcasset convert_from_exchange( connector& reserve, const asset& tokens )reserve:预定量,payment:支付金额;从交易所价格转回实际价格 实 际 可 购 买 数 量 = 预 定 数 量 × [ 1 + 支 付 金 额 ÷ 供 应 量 小 费 − 1 ] 实际可购买数量=预定数量\times[\sqrt[小费]{1+支付金额\div供应量}-1] =×[1+÷ 1]
funcasset covert( const asset& from, const symbol& to )汇率转换,流程:1.convert_to_exchange到交易所,2.convert_from_exchange从交易所转回来
funcasset direct_convert( const asset& from, const symbol& to )bancor算法 计算价格,并设置实时价格
funcstatic int64_t get_bancor_output( int64_t inp_reserve, int64_t out_reserve, int64_t inp)获得bancor输出
funcstatic int64_t get_bancor_input(int64_t out_reserve, int64_t inp_reserve, int64_t out)获得bancor输入

定义类

permission_level_weight 等级权限
类型名字注释
permission_levelpermission等级
uint16_tweight权重
key_weight 键权重
类型名字注释
eosio::public_keykey
uint16_tweight权重
wait_weight 等待时间权重
类型名字注释
uint32_twait_sec等待秒数
uint16_tweight权重
authority 权限验证
类型名字注释
uint32_tthreshold0, 起点
std::vector<key_weight>keyskey权重
std::vector<permission_level_weight>accounts权限等级权重
std::vector<wait_weight>waits等待权重
block_header 块头
类型名字注释
uint32_ttimestamp时间戳
nameproducer块头生产者
checksum256previous上一个块
checksum256transaction_mroot只想transaction根节点
checksum256action_mroot指向action根节点
uint32_tschedule_version0, 调度器版本
std::optionaleosio::producer_schedulenew_producers新的生产者

rex.results合约

//购买结果
void buyresult( const asset& rex_received )
//出售结果
void sellresult( const asset& proceeds )
//预订结果
void orderresult( const name& owner, const asset& proceeds )
//出租结果
void rentresult( const asset& rented_tokens )
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值