Module Manager
Functionalities
Enable Module
Function:
enableModule(string memory moduleName_, address moduleAddress_)
Purpose: Registers and enables a new module.
Parameters:
moduleName_
: The name of the module.moduleAddress_
: The address of the deployed module.
Validation:
Ensures that the module address, name, and the calling address are valid.
Checks that the module is not already registered.
Event: Emits
ModuleEnabled
with the module name and address.
Disable Module
Function:
disableModule(string memory moduleName_)
Purpose: Disables a previously enabled module.
Parameters:
moduleName_
: The name of the module to be disabled.
Validation:
Ensures that the module name is valid.
Checks that the module is currently enabled.
Event: Emits
ModuleDisabled
with the module name.
Execute Module Transaction
Function:
executeModuleTransaction(string memory moduleName_, uint256 value_, bytes memory data_, Enum.Operation operation_)
Purpose: Executes arbitrary code on a module.
Parameters:
moduleName_
: The name of the module.value_
: Ether value for the transaction.data_
: Encoded data for the function call.operation_
: Type of call (e.g., call or delegatecall).
Process:
Validates that the module is registered.
Checks permissions using the
Executor
contract.Executes the transaction via the
Executor
contract.
Events: Depending on success or failure, emits either
ExecuteFromModuleSuccess
orExecuteFromModuleFailure
with the module name and transaction hash.
Check Module Status
Function:
isModuleEnabled(string memory moduleName_)
Purpose: Checks if a given module is enabled.
Parameters:
moduleName_
: The name of the module.
Returns: Boolean value indicating whether the module is enabled.
Get Module Address
Function:
getModuleAddress(string memory moduleName_)
Purpose: Retrieves the address of a deployed module.
Parameters:
moduleName_
: The name of the module.
Returns: Address of the module.
Last updated