Wire Sysio Wire Sysion 1.0.0
|
#include <sysio.bios.hpp>
Classes | |
struct | abi_hash |
Public Types | |
typedef sysio::multi_index< "abihash"_n, abi_hash > | abi_hash_table |
using | newaccount_action = action_wrapper<"newaccount"_n, &bios::newaccount> |
using | updateauth_action = action_wrapper<"updateauth"_n, &bios::updateauth> |
using | deleteauth_action = action_wrapper<"deleteauth"_n, &bios::deleteauth> |
using | linkauth_action = action_wrapper<"linkauth"_n, &bios::linkauth> |
using | unlinkauth_action = action_wrapper<"unlinkauth"_n, &bios::unlinkauth> |
using | canceldelay_action = action_wrapper<"canceldelay"_n, &bios::canceldelay> |
using | setcode_action = action_wrapper<"setcode"_n, &bios::setcode> |
using | setabi_action = action_wrapper<"setabi"_n, &bios::setabi> |
using | setpriv_action = action_wrapper<"setpriv"_n, &bios::setpriv> |
using | setalimits_action = action_wrapper<"setalimits"_n, &bios::setalimits> |
using | setprods_action = action_wrapper<"setprods"_n, &bios::setprods> |
using | setparams_action = action_wrapper<"setparams"_n, &bios::setparams> |
using | reqauth_action = action_wrapper<"reqauth"_n, &bios::reqauth> |
using | activate_action = action_wrapper<"activate"_n, &bios::activate> |
using | reqactivated_action = action_wrapper<"reqactivated"_n, &bios::reqactivated> |
Public Member Functions | |
void | newaccount (name creator, name name, ignore< authority > owner, ignore< authority > active) |
void | updateauth (ignore< name > account, ignore< name > permission, ignore< name > parent, ignore< authority > auth) |
void | deleteauth (ignore< name > account, ignore< name > permission) |
void | linkauth (ignore< name > account, ignore< name > code, ignore< name > type, ignore< name > requirement) |
void | unlinkauth (ignore< name > account, ignore< name > code, ignore< name > type) |
void | canceldelay (ignore< permission_level > canceling_auth, ignore< checksum256 > trx_id) |
void | setcode (name account, uint8_t vmtype, uint8_t vmversion, const std::vector< char > &code) |
void | setabi (name account, const std::vector< char > &abi) |
void | onerror (ignore< uint128_t > sender_id, ignore< std::vector< char > > sent_trx) |
void | setpriv (name account, uint8_t is_priv) |
void | setalimits (name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight) |
void | setprods (const std::vector< sysio::producer_authority > &schedule) |
void | setparams (const sysio::blockchain_parameters ¶ms) |
void | reqauth (name from) |
void | activate (const sysio::checksum256 &feature_digest) |
void | reqactivated (const sysio::checksum256 &feature_digest) |
The sysio.bios
is the first sample of system contract provided by block.one
through the EOSIO platform. It is a minimalist system contract because it only supplies the actions that are absolutely critical to bootstrap a chain and nothing more. This allows for a chain agnostic approach to bootstrapping a chain.
Just like in the sysio.system
sample contract implementation, there are a few actions which are not implemented at the contract level (newaccount
, updateauth
, deleteauth
, linkauth
, unlinkauth
, canceldelay
, onerror
, setabi
, setcode
), they are just declared in the contract so they will show in the contract's ABI and users will be able to push those actions to the chain via the account holding the sysio.system
contract, but the implementation is at the EOSIO core level. They are referred to as EOSIO native actions.
Definition at line 74 of file sysio.bios.hpp.
sysio::multi_index< "abihash"_n, abi_hash > sysiobios::bios::abi_hash_table |
Definition at line 264 of file sysio.bios.hpp.
using sysiobios::bios::activate_action = action_wrapper<"activate"_n, &bios::activate> |
Definition at line 279 of file sysio.bios.hpp.
using sysiobios::bios::canceldelay_action = action_wrapper<"canceldelay"_n, &bios::canceldelay> |
Definition at line 271 of file sysio.bios.hpp.
using sysiobios::bios::deleteauth_action = action_wrapper<"deleteauth"_n, &bios::deleteauth> |
Definition at line 268 of file sysio.bios.hpp.
using sysiobios::bios::linkauth_action = action_wrapper<"linkauth"_n, &bios::linkauth> |
Definition at line 269 of file sysio.bios.hpp.
using sysiobios::bios::newaccount_action = action_wrapper<"newaccount"_n, &bios::newaccount> |
Definition at line 266 of file sysio.bios.hpp.
using sysiobios::bios::reqactivated_action = action_wrapper<"reqactivated"_n, &bios::reqactivated> |
Definition at line 280 of file sysio.bios.hpp.
using sysiobios::bios::reqauth_action = action_wrapper<"reqauth"_n, &bios::reqauth> |
Definition at line 278 of file sysio.bios.hpp.
using sysiobios::bios::setabi_action = action_wrapper<"setabi"_n, &bios::setabi> |
Definition at line 273 of file sysio.bios.hpp.
using sysiobios::bios::setalimits_action = action_wrapper<"setalimits"_n, &bios::setalimits> |
Definition at line 275 of file sysio.bios.hpp.
using sysiobios::bios::setcode_action = action_wrapper<"setcode"_n, &bios::setcode> |
Definition at line 272 of file sysio.bios.hpp.
using sysiobios::bios::setparams_action = action_wrapper<"setparams"_n, &bios::setparams> |
Definition at line 277 of file sysio.bios.hpp.
using sysiobios::bios::setpriv_action = action_wrapper<"setpriv"_n, &bios::setpriv> |
Definition at line 274 of file sysio.bios.hpp.
using sysiobios::bios::setprods_action = action_wrapper<"setprods"_n, &bios::setprods> |
Definition at line 276 of file sysio.bios.hpp.
using sysiobios::bios::unlinkauth_action = action_wrapper<"unlinkauth"_n, &bios::unlinkauth> |
Definition at line 270 of file sysio.bios.hpp.
using sysiobios::bios::updateauth_action = action_wrapper<"updateauth"_n, &bios::updateauth> |
Definition at line 267 of file sysio.bios.hpp.
void sysiobios::bios::activate | ( | const sysio::checksum256 & | feature_digest | ) |
Activate action, activates a protocol feature
feature_digest | - hash of the protocol feature to activate. |
Definition at line 48 of file sysio.bios.cpp.
|
inline |
Cancel delay action cancels a deferred transaction.
canceling_auth | - the permission that authorizes this action, |
trx_id | - the deferred transaction id to be cancelled. |
Definition at line 158 of file sysio.bios.hpp.
Delete authorization action deletes the authorization for an account's permission.
account | - the account for which the permission authorization is deleted, |
permission | - the permission name been deleted. |
Definition at line 115 of file sysio.bios.hpp.
|
inline |
Link authorization action assigns a specific action from a contract to a permission you have created. Five system actions can not be linked updateauth
, deleteauth
, linkauth
, unlinkauth
, and canceldelay
. This is useful because when doing authorization checks, the EOSIO based blockchain starts with the action needed to be authorized (and the contract belonging to), and looks up which permission is needed to pass authorization validation. If a link is set, that permission is used for authoraization validation otherwise then active is the default, with the exception of sysio.any
. sysio.any
is an implicit permission which exists on every account; you can link actions to sysio.any
and that will make it so linked actions are accessible to any permissions defined for the account.
account | - the permission's owner to be linked and the payer of the RAM needed to store this link, |
code | - the owner of the action to be linked, |
type | - the action to be linked, |
requirement | - the permission to be linked. |
Definition at line 134 of file sysio.bios.hpp.
|
inline |
New account action, called after a new account is created. This code enforces resource-limits rules for new accounts as well as new account naming conventions.
Definition at line 90 of file sysio.bios.hpp.
void sysiobios::bios::onerror | ( | ignore< uint128_t > | sender_id, |
ignore< std::vector< char > > | sent_trx ) |
On error action, 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.
sender_id | - the id for the deferred transaction chosen by the sender, |
sent_trx | - the deferred transaction that failed. |
Definition at line 20 of file sysio.bios.cpp.
void sysiobios::bios::reqactivated | ( | const sysio::checksum256 & | feature_digest | ) |
Require activated action, asserts that a protocol feature has been activated
feature_digest | - hash of the protocol feature to check for activation. |
Definition at line 53 of file sysio.bios.cpp.
void sysiobios::bios::reqauth | ( | name | from | ) |
Require authorization action, checks if the account name from
passed in as param has authorization to access current action, that is, if it is listed in the action’s allowed permissions vector.
from | - the account name to authorize |
Definition at line 44 of file sysio.bios.cpp.
void sysiobios::bios::setabi | ( | name | account, |
const std::vector< char > & | abi ) |
Set abi action sets the abi for contract identified by account
name. Creates an entry in the abi_hash_table index, with account
name as key, if it is not already present and sets its value with the abi hash. Otherwise it is updating the current abi hash value for the existing account
key.
account | - the name of the account to set the abi for |
abi | - the abi hash represented as a vector of characters |
Definition at line 5 of file sysio.bios.cpp.
void sysiobios::bios::setalimits | ( | name | account, |
int64_t | ram_bytes, | ||
int64_t | net_weight, | ||
int64_t | cpu_weight ) |
Sets the resource limits of an account
account | - name of the account whose resource limit to be set |
ram_bytes | - ram limit in absolute bytes |
net_weight | - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts) |
cpu_weight | - fractionally proportionate cpu limit of available resources based on (weight / total_weight_of_all_accounts) |
Definition at line 29 of file sysio.bios.cpp.
|
inline |
Set code action sets the contract code for an account.
account | - the account for which to set the contract code. |
vmtype | - reserved, set it to zero. |
vmversion | - reserved, set it to zero. |
code | - the code content to be set, in the form of a blob binary.. |
Definition at line 169 of file sysio.bios.hpp.
void sysiobios::bios::setparams | ( | const sysio::blockchain_parameters & | params | ) |
Set params action, sets the blockchain parameters. By tuning these parameters, various degrees of customization can be achieved.
params | - New blockchain parameters to set |
Definition at line 39 of file sysio.bios.cpp.
Set privilege action allows to set privilege status for an account (turn it on/off).
account | - the account to set the privileged status for. |
is_priv | - 0 for false, > 0 for true. |
Definition at line 24 of file sysio.bios.cpp.
void sysiobios::bios::setprods | ( | const std::vector< sysio::producer_authority > & | schedule | ) |
Set producers action, sets a new list of active producers, by proposing a schedule change, once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active".
schedule | - New list of active producers to set |
Definition at line 34 of file sysio.bios.cpp.
|
inline |
Unlink authorization action it's doing the reverse of linkauth action, by unlinking the given action.
account | - the owner of the permission to be unlinked and the receiver of the freed RAM, |
code | - the owner of the action to be unlinked, |
type | - the action to be unlinked. |
Definition at line 147 of file sysio.bios.hpp.
|
inline |
Update authorization action updates pemission for an account.
account | - the account for which the permission is updated, |
pemission | - the permission name which is updated, |
parem | - the parent of the permission which is updated, |
aut | - the json describing the permission authorization. |
Definition at line 103 of file sysio.bios.hpp.