Skip to main content

sysio.bios

Overview

The sysio.bios is a minimalist system contract that supplies only the actions that are absolutely critical to bootstrap a chain and nothing more. Similar to 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, 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 Wire Sysio core level. They are referred to as native actions

Actions

newaccount

Type: void

Called after a new account is created, enforcing resource limits and naming conventions for new accounts.

Parameter NameDescription
creatorThe account creating the new account
nameThe name of the new account
ownerThe owner authority of the new account
activeThe active authority of the new account

updateauth

Type: void

Update authorization action updates permission for an account.

Parameter NameDescription
accountThe account for which the permission is updated.
permissionThe permission name which is updated.
parentThe parent of the permission which is updated.
authThe JSON describing the permission authorization.

deleteauth

Type: void

Deletes the authorization for an account's permission.

Parameter NameDescription
accountThe account for which the permission is deleted.
permissionThe permission name to be deleted.

linkauth

Type: void

Assigns a specific action from a contract to a permission you have created.

Parameter NameDescription
accountThe permission's owner to be linked
codeThe contract to link the action from
typeThe action to be linked
requirementThe permission to be linked

Five system actions can not be linked: updateauth, deleteauth, linkauth, unlinkauth, and canceldelay.

When doing authorization checks, Wire 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 authorization validation, otherwise active is the default, with the exception of sysio.any. sysio.any is an implicit permission which exists on every account. By linking actions to sysio.any they become accessible to any permissions defined for the account.


unlinkauth

Type: void

Unlinks a previously linked action.

Parameter NameDescription
accountThe owner of the permission to be unlinked.
codeThe contract from which the action is unlinked.
typeThe action to be unlinked.

canceldelay

Type: void

Cancel delay action cancels a deferred transaction..

Parameter NameDescription
canceling_auththe permission that authorizes this action.
trx_idthe deferred transaction id to be cancelled.

setcode

Type: void

Sets the contract code for an account.

Parameter NameDescription
accountThe account for which to set the contract code.
vmtypeReserved, set to zero.
vmversionReserved, set to zero.
codeThe contract code content.

setabi

Type: void

Sets the ABI for a contract.

Parameter NameDescription
accountThe account to set the ABI for.
abiThe ABI content represented as a vector of characters.

onerror

Type: void

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.

Parameter NameDescription
sender_idthe id for the deferred transaction chosen by the sender.
sent_trxthe deferred transaction that failed.

setpriv

Sets the privilege status for an account (turn it on/off).

Parameter NameDescription
accountThe account to set the privileged status for.
is_priv0 for false, > 0 for true to indicate privilege status.

setalimits

Sets the resource limits of an account.

Parameter NameDescription
accountName of the account whose resource limit to be set.
ram_bytesRAM limit in absolute bytes.
net_weightFractionally proportionate net limit of available resources based on weight ratio.
cpu_weightFractionally proportionate CPU limit of available resources based on weight ratio.

setprods

Sets a new list of active producers by proposing a schedule change. This schedule change becomes “pending” once the proposal’s block is irreversible and then “active” once the block promoting the schedule is also irreversible.

Parameter NameDescription
scheduleNew list of active producers to set.

setparams

Sets the blockchain parameters allowing for various degrees of customization.

Parameter NameDescription
paramsNew blockchain parameters to set for customization.

reqauth

Checks if from has authorization to access the current action, assuming if it's listed in the action’s allowed permissions vector.

Parameter NameDescription
fromThe account name to check authorization for.

activate

Activates a protocol feature.

Parameter NameDescription
feature_digestHash of the protocol feature to activate.

reqactivated

Asserts that a protocol feature has been activated.

Parameter NameDescription
feature_digestHash of the protocol feature to check for activation.