Skip to main content

Module

Base level extension of the kernel. Modules act as independent state components to be interacted with and mutated through policies.

Modules are installed and uninstalled via the executor.

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

kernel

function kernel() external view returns (contract Kernel)

Returns

NameTypeDescription
_0contract Kernelundefined

Errors

KernelAdapter_OnlyKernel

error KernelAdapter_OnlyKernel(address caller_)

Parameters

NameTypeDescription
caller_addressundefined

Module_PolicyNotPermitted

error Module_PolicyNotPermitted(address policy_)

Parameters

NameTypeDescription
policy_addressundefined