Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IERC7579ModuleConfig

ERC-7579 Module Config. Accounts should implement this interface to allow installing and uninstalling modules.

Functions

installModule

Installs a Module of a certain type on the smart account

function installModule(uint256 moduleTypeId, address module, bytes calldata initData) external;

Parameters

NameTypeDescription
moduleTypeIduint256the module type ID according to the ERC-7579 spec
moduleaddressthe module address
initDatabytesarbitrary data that may be passed to the module during onInstall initialization. MUST implement authorization control MUST call onInstall on the module with the initData parameter if provided MUST emit ModuleInstalled event MUST revert if the module is already installed or the initialization on the module failed

uninstallModule

Uninstalls a Module of a certain type on the smart account

function uninstallModule(uint256 moduleTypeId, address module, bytes calldata deInitData) external;

Parameters

NameTypeDescription
moduleTypeIduint256the module type ID according the ERC-7579 spec
moduleaddressthe module address
deInitDatabytesarbitrary data that may be passed to the module during onUninstall deinitialization. MUST implement authorization control MUST call onUninstall on the module with the deInitData parameter if provided MUST emit ModuleUninstalled event MUST revert if the module is not installed or the deInitialization on the module failed

isModuleInstalled

Returns whether a module is installed on the smart account

function isModuleInstalled(uint256 moduleTypeId, address module, bytes calldata additionalContext)
    external
    view
    returns (bool);

Parameters

NameTypeDescription
moduleTypeIduint256the module type ID according the ERC-7579 spec
moduleaddressthe module address
additionalContextbytesarbitrary data that may be passed to determine if the module is installed MUST return true if the module is installed and false otherwise

Events

ModuleInstalled

event ModuleInstalled(uint256 moduleTypeId, address module);

ModuleUninstalled

event ModuleUninstalled(uint256 moduleTypeId, address module);