Skip to content

System actions

Everything in Highlayer is an action.

Smart contract calls are actions, writes to the system are actions.

You can find action structure here - Action.

Below you can find a comprehensive list of system actions.

allocateGas

Used to burn some token amount (from signer's address) to allocate gas. Must be the first action of any user emitted transaction except sequencerDeposit.

Params:

Parameter nameParameter data typeDescription of parameter
amountString of digitsAmount of gas to allocate for rest of transaction.
priceIntegerPrice that signer is willing to pay per unit of gas. Must be equal or more than global gas price.

Gas cost: -amount

sequencerDeposit

Used to deposit coins to sequencer. See depositing to sequencer for more details.

Params:

Parameter nameParameter data typeDescription of parameter
amountString of digitsAmount of alans to deposit to sequencer.
accountToString (highlayer/bitcoin address)Optional address that will receive this sequencer deposit. Will default to signer's address.

Gas cost: 0

transfer

Used to transfer $HI token to another address.

Params:

Parameter nameParameter data typeDescription of parameter
amountString of digitsAmount of alans to transfer.
recipientString (highlayer/bitcoin address)Address that will receive coins.

Gas cost: 5000, 10000 on top of it's address entry creation (address has never received anything before).

uploadData

Used to upload arbitrary data to highlayer. It is also the way to upload smart contract sources.

Params:

Parameter nameParameter data typeDescription of parameter
dataString (base64)Base64-encoded data (will be decoded by nodes right before storing it) to upload to Highlayer.

Gas cost: 700 per byte.

log

Used to log arbitrary data to address log

Params:

Parameter nameParameter data typeDescription of parameter
messageString (or anything stringifyable)Message to log to account log.

Gas cost: 1000

createContract

Used to instantiate (initialize) contract with source and list of initial actions that contract must execute upon its creation.

Params:

Parameter nameParameter data typeDescription of parameter
sourceIdStringID of data stored on Highlayer (via uploadData) that will be used as contract's source
initActionsList(Action)List of actions that the deployed contract will execute right away after its creation. Usually used to configure contract's KV and perform other configuration/initialization steps.
gasForInitActionsString of digitsGas allocated for deployment actions from initActions field.

Gas cost: 10000 + amount specified in gasForInitActions field.

kvStore

Used to store entry in account's KV store. Usually acts as database for smart contracts, but also possible to use from user-owned account.

Params:

Parameter nameParameter data typeDescription of parameter
keyStringArbitrary key under which to store value.
valueAny primitive data typeArbitrary data to store under key.

Gas cost: 1000 + 700 per byte in key field, 100 per byte in value field (msgpack-ed before measuring).