Functions#
storage_read#
Reads data from contract storage at the specified slot and index.
Requirements#
Sub-VM must be in deterministic mode
index + buf_len must not exceed the Storage Slot length
storage_write#
Writes data to contract storage at the specified slot and index.
Requirements#
Sub-VM must be in deterministic mode
Sub-VM must have write storage permission
index + buf_len must not exceed the Storage Slot length
Sub-VM Storage slot must not be locked, unless the sender is in
upgraders
get_balance#
Queries the balance of a specified contract address.
Result value is a 32 octets long little-endian unsigned integer
get_self_balance#
Gets the current contract’s balance, adjusted for the current transaction context. It is following: balance_before_transaction + message.value - value_consumed_by_current_tx
Result value is a 32 octets long little-endian unsigned integer
Requirements#
Contract must be in deterministic mode
gl_call#
Primary GenLayer WASI SDK function handling most intelligent contract operations. Takes serialized Calldata Encoded message buffer and dispatches to various blockchain operations based on message type.
Parameters: request (calldata buffer), request_len (buffer length), result_fd (output file descriptor)
Returns
error_successon successerror_invalfor invalid requestserror_forbiddenfor permission violationserror_insufficient_balancefor insufficient balance
See gl_call Messages for the list of available messages.