World
Reference
Modules (interface)

IModule

Git Source (opens in a new tab)

Inherits: IERC165, IModuleErrors

Interface for the Module system. A module can be installed within the context of a world, either as a root or non-root module. This interface adheres to the ERC-165 standard for determining interface support.

Functions

installRoot

Installs the module as a root module.

This function is invoked by the World contract during installRootModule process. The module expects to be called via the World contract and thus installs itself on the msg.sender.

function installRoot(bytes memory encodedArgs) external;

Parameters

NameTypeDescription
encodedArgsbytesThe ABI encoded arguments that may be needed during the installation process.

install

Installs the module.

This function is invoked by the World contract during installModule process. The module expects to be called via the World contract and thus installs itself on the msg.sender. Logic might differ from installRoot, for example, this might accept namespace parameters.

function install(bytes memory encodedArgs) external;

Parameters

NameTypeDescription
encodedArgsbytesThe ABI encoded arguments that may be needed during the installation process.

IModuleErrors

Git Source (opens in a new tab)

This interface includes errors for the Module library.

We bundle these errors in an interface (instead of at the file-level or in their corresponding library) so they can be inherited by IWorldKernel. This ensures that all errors are included in the IWorldKernel ABI for proper decoding in the frontend.

Errors

Module_RootInstallNotSupported

Error raised if installing in root is not supported.

error Module_RootInstallNotSupported();

Module_NonRootInstallNotSupported

Error raised if installing in non-root is not supported.

error Module_NonRootInstallNotSupported();

Module_AlreadyInstalled

Error raised if the provided module is already installed.

error Module_AlreadyInstalled();

Module_MissingDependency

Error raised if the provided module is missing a dependency.

error Module_MissingDependency(address dependency);

Parameters

NameTypeDescription
dependencyaddressThe address of the dependency.