一起来读源码67-eosio.contracts eosio.bios

摘要

功能:1.检测、设置指定账户的权限;2.限制指定账户或全局的资源使用;3.设置区块生产者

类似超级管理员;

详情

定义action

接口 参数 说明
newaccount

name 创建者, name 账号名, ignore<authority> owner权限, ignore<authority> active权限

新建账号,强制资源限制;1.12个字符长,不能包含".";2.新账号创建时需要一点点token;

updateauth

ignore<name> 账号, ignore<name> 权限, ignore<name> 父账号,

ignore<authority> 权限

更新权限
deleteauth

ignore<name> 账号, ignore<name> 权限

删除权限
linkauth

ignore<name> 账号, ignore<name> 合约部署者 , ignore<name> 需要赋权的action, ignore<name> 权限

赋予权限,给action签名;对以下系统action:updateauth, deleteauth, linkauth, unlinkauth, canceldelay无效;用来做权限验证很方便,如果不赋予权限,默认eosio.any

unlinkauth

ignore<name> 账号, ignore<name> 合约部署者, ignore<name> 合约

取消赋权
canceldelay

ignore<permission_level> 权限, ignore<checksum256> 传输id

取消一个延时传输
setcode

name 合约部署者, uint8_t vm类型, uint8_t vm版本, const std::vector<char>& 合约

设置合约
setabi

name 账号, const std::vector<char>& abi

设置abi
onerror

ignore<uint128_t> 发送者, ignore<std::vector<char>> 报错的传输

错误回调
setpriv

name 账号, uint8_t 是否开启特权

设置特权,0不开,>0开启
setalimits

name 账号, int64_t 内存字节大小, int64_t 网络, int64_t cpu

设置资源限制
setprods

const std::vector<eosio::producer_authority>& 权限集合

设置节点
setparams

const eosio::blockchain_parameters& 参数

设置系统参数
reqauth

name 验证者

权限验证,reqauth2不能用了
activate const eosio::checksum256& 协议 激活协议
reqactivated

const eosio::checksum256& 协议

判断协议是否激活

猜你喜欢

转载自blog.csdn.net/qq_27304213/article/details/107343604