World
Reference
Modules

Module

Git Source (opens in a new tab)

Inherits: IModule, WorldContextConsumer

Abstract contract that implements the ERC-165 supportsInterface function for IModule.

State Variables

__self

address internal immutable __self = address(this);

Functions

supportsInterface

Checks if the given interfaceId is supported by this contract.

Overrides the functionality from IERC165 and WorldContextConsumer to check for supported interfaces.

function supportsInterface(
  bytes4 interfaceId
) public pure virtual override(IERC165, WorldContextConsumer) returns (bool);

Parameters

NameTypeDescription
interfaceIdbytes4The bytes4 identifier for the interface.

Returns

NameTypeDescription
<none>booltrue if the interface is supported, false otherwise.

isInstalled

Check if a module with the given name and arguments is installed.

function isInstalled(address moduleAddress, bytes memory encodedArgs) internal view returns (bool);

Parameters

NameTypeDescription
moduleAddressaddressThe address of the module.
encodedArgsbytesThe ABI encoded arguments for the module installation.

Returns

NameTypeDescription
<none>booltrue if the module is installed, false otherwise.

requireNotInstalled

Revert if the module with the given name and arguments is already installed.

function requireNotInstalled(address moduleAddress, bytes memory encodedArgs) internal view;

Parameters

NameTypeDescription
moduleAddressaddressThe address of the module.
encodedArgsbytesThe ABI encoded arguments for the module installation.