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
Name | Type | Description |
---|---|---|
_0 | Keycode | undefined |
VERSION
function VERSION() external pure returns (uint8 major, uint8 minor)
Returns which semantic version of a module is being implemented.
Returns
Name | Type | Description |
---|---|---|
major | uint8 | - Major version upgrade indicates breaking change to the interface. |
minor | uint8 | - 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
Name | Type | Description |
---|---|---|
newKernel_ | contract Kernel | undefined |
kernel
function kernel() external view returns (contract Kernel)
Returns
Name | Type | Description |
---|---|---|
_0 | contract Kernel | undefined |
Errors
KernelAdapter_OnlyKernel
error KernelAdapter_OnlyKernel(address caller_)
Parameters
Name | Type | Description |
---|---|---|
caller_ | address | undefined |
Module_PolicyNotPermitted
error Module_PolicyNotPermitted(address policy_)
Parameters
Name | Type | Description |
---|---|---|
policy_ | address | undefined |