Skip to main content

INSTRv1

Caches and executes batched instructions for protocol upgrades in the Kernel.

Methods

INIT

function INIT() external nonpayable

Initialization function for the module

This function is called when the module is installed or upgraded by the kernel.MUST BE GATED BY onlyKernel. Used to encompass any initialization or upgrade logic.

KEYCODE

function KEYCODE() external pure returns (Keycode)

5 byte identifier for a module.

Returns

NameTypeDescription
_0Keycodeundefined

VERSION

function VERSION() external pure returns (uint8 major, uint8 minor)

Returns which semantic version of a module is being implemented.

Returns

NameTypeDescription
majoruint8- Major version upgrade indicates breaking change to the interface.
minoruint8- Minor version change retains backward-compatible interface.

changeKernel

function changeKernel(contract Kernel newKernel_) external nonpayable

Function used by kernel when migrating to a new kernel.

Parameters

NameTypeDescription
newKernel_contract Kernelundefined

getInstructions

function getInstructions(uint256 instructionsId_) external nonpayable returns (struct Instruction[])

View function for retrieving a list of Instructions in an outside contract.

Parameters

NameTypeDescription
instructionsId_uint256undefined

Returns

NameTypeDescription
_0Instruction[]undefined

kernel

function kernel() external view returns (contract Kernel)

Returns

NameTypeDescription
_0contract Kernelundefined

store

function store(Instruction[] instructions_) external nonpayable returns (uint256)

Parameters

NameTypeDescription
instructions_Instruction[]undefined

Returns

NameTypeDescription
_0uint256undefined

storedInstructions

function storedInstructions(uint256, uint256) external view returns (enum Actions action, address target)

All stored instructions per count in totalInstructions

Parameters

NameTypeDescription
_0uint256undefined
_1uint256undefined

Returns

NameTypeDescription
actionenum Actionsundefined
targetaddressundefined

totalInstructions

function totalInstructions() external view returns (uint256)

Counter of total instructions

Returns

NameTypeDescription
_0uint256undefined

Events

InstructionsStored

event InstructionsStored(uint256 instructionsId)

Parameters

NameTypeDescription
instructionsIduint256undefined

Errors

INSTR_InstructionsCannotBeEmpty

error INSTR_InstructionsCannotBeEmpty()

INSTR_InvalidAction

error INSTR_InvalidAction()

KernelAdapter_OnlyKernel

error KernelAdapter_OnlyKernel(address caller_)

Parameters

NameTypeDescription
caller_addressundefined

Module_PolicyNotPermitted

error Module_PolicyNotPermitted(address policy_)

Parameters

NameTypeDescription
policy_addressundefined