Skip to content

Latest commit

 

History

History
521 lines (415 loc) · 15.7 KB

IModulesProxyRegistry.md

File metadata and controls

521 lines (415 loc) · 15.7 KB

IModulesProxyRegistry.sol

View Source: contracts/proxy/modules/interfaces/IModulesProxyRegistry.sol

↘ Derived Contracts: ModulesProxyRegistry

IModulesProxyRegistry contract

Events

event AddModule(address indexed moduleAddress);
event ReplaceModule(address indexed oldAddress, address indexed newAddress);
event RemoveModule(address indexed moduleAddress);
event SetModuleFuncImplementation(bytes4 indexed _funcSig, address indexed _oldImplementation, address indexed _newImplementation);

Functions


addModule

⤿ Overridden Implementation(s): ModulesProxyRegistry.addModule

Add module functions. Overriding functions is not allowed. To replace modules use ReplaceModule function.

function addModule(address _impl) external nonpayable

Arguments

Name Type Description
_impl address Module implementation address
Source Code
function addModule(address _impl) external;

addModules

⤿ Overridden Implementation(s): ModulesProxyRegistry.addModules

Add modules functions.

function addModules(address[] _implementations) external nonpayable

Arguments

Name Type Description
_implementations address[] Modules implementation addresses
Source Code
function addModules(address[] calldata _implementations) external;

replaceModule

⤿ Overridden Implementation(s): ModulesProxyRegistry.replaceModule

Replace module - remove the previous, add the new one

function replaceModule(address _oldModuleImpl, address _newModuleImpl) external nonpayable

Arguments

Name Type Description
_oldModuleImpl address Module implementation address to remove
_newModuleImpl address Module implementation address to add
Source Code
function replaceModule(address _oldModuleImpl, address _newModuleImpl) external;

replaceModules

⤿ Overridden Implementation(s): ModulesProxyRegistry.replaceModules

Add modules functions.

function replaceModules(address[] _implementationsFrom, address[] _implementationsTo) external nonpayable

Arguments

Name Type Description
_implementationsFrom address[] Modules to replace
_implementationsTo address[] Replacing modules
Source Code
function replaceModules(
        address[] calldata _implementationsFrom,
        address[] calldata _implementationsTo
    ) external;

removeModule

⤿ Overridden Implementation(s): ModulesProxyRegistry.removeModule

to disable module - set all its functions implementation to address(0)

function removeModule(address _impl) external nonpayable

Arguments

Name Type Description
_impl address implementation address
Source Code
function removeModule(address _impl) external;

removeModules

⤿ Overridden Implementation(s): ModulesProxyRegistry.removeModules

Add modules functions.

function removeModules(address[] _implementations) external nonpayable

Arguments

Name Type Description
_implementations address[] Modules implementation addresses
Source Code
function removeModules(address[] calldata _implementations) external;

getFuncImplementation

⤿ Overridden Implementation(s): ModulesProxyRegistry.getFuncImplementation

function getFuncImplementation(bytes4 _sig) external view
returns(address)

Arguments

Name Type Description
_sig bytes4 function signature to get impmementation address for

Returns

function's contract implelementation address

Source Code
function getFuncImplementation(bytes4 _sig) external view returns (address);

canAddModule

⤿ Overridden Implementation(s): ModulesProxyRegistry.canAddModule

verifies if no functions from the module deployed already registered

function canAddModule(address _impl) external view
returns(bool)

Arguments

Name Type Description
_impl address module implementation address to verify

Returns

true if module can be added

Source Code
function canAddModule(address _impl) external view returns (bool);

canNotAddModules

⤿ Overridden Implementation(s): ModulesProxyRegistry.canNotAddModules

Multiple modules verification if no functions from the modules already registered

function canNotAddModules(address[] _implementations) external view
returns(modules address[])

Arguments

Name Type Description
_implementations address[] modules implementation addresses to verify

Returns

True if all modules can be added, false otherwise

Source Code
function canNotAddModules(address[] calldata _implementations)
        external
        view
        returns (address[] memory modules);

checkClashingFuncSelectors

⤿ Overridden Implementation(s): ModulesProxyRegistry.checkClashingFuncSelectors

used externally to verify module being added for clashing

function checkClashingFuncSelectors(address _newModule) external view
returns(clashingModules address[], clashingModulesFuncSelectors bytes4[], clashingProxyRegistryFuncSelectors bytes4[])

Arguments

Name Type Description
_newModule address module implementation which functions to verify

Returns

clashing functions signatures and corresponding modules (contracts) addresses

Source Code
function checkClashingFuncSelectors(address _newModule)
        external
        view
        returns (
            address[] memory clashingModules,
            bytes4[] memory clashingModulesFuncSelectors,
            bytes4[] memory clashingProxyRegistryFuncSelectors
        );

Contracts