Skip to main content

Module

Git Source

Inherits: KernelAdapter

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.

Functions

constructor

constructor(Kernel kernel_) KernelAdapter(kernel_);

permissioned

Modifier to restrict which policies have access to module functions.

modifier permissioned();

KEYCODE

5 byte identifier for a module.

function KEYCODE() public pure virtual returns (Keycode);

VERSION

Returns which semantic version of a module is being implemented.

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

Returns

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

INIT

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.

function INIT() external virtual onlyKernel;

Errors

Module_PolicyNotPermitted

error Module_PolicyNotPermitted(address policy_);