diff --git a/src/MSAAdvanced.sol b/src/MSAAdvanced.sol index f14c160..7f87271 100644 --- a/src/MSAAdvanced.sol +++ b/src/MSAAdvanced.sol @@ -146,7 +146,7 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { * @inheritdoc IERC7579Account */ function installModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata initData ) @@ -154,19 +154,19 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { payable onlyEntryPointOrSelf { - if (moduleType == MODULE_TYPE_VALIDATOR) _installValidator(module, initData); - else if (moduleType == MODULE_TYPE_EXECUTOR) _installExecutor(module, initData); - else if (moduleType == MODULE_TYPE_FALLBACK) _installFallbackHandler(module, initData); - else if (moduleType == MODULE_TYPE_HOOK) _installHook(module, initData); - else revert UnsupportedModuleType(moduleType); - emit ModuleInstalled(moduleType, module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) _installValidator(module, initData); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) _installExecutor(module, initData); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) _installFallbackHandler(module, initData); + else if (moduleTypeId == MODULE_TYPE_HOOK) _installHook(module, initData); + else revert UnsupportedModuleType(moduleTypeId); + emit ModuleInstalled(moduleTypeId, module); } /** * @inheritdoc IERC7579Account */ function uninstallModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata deInitData ) @@ -174,12 +174,12 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { payable onlyEntryPointOrSelf { - if (moduleType == MODULE_TYPE_VALIDATOR) _uninstallValidator(module, deInitData); - else if (moduleType == MODULE_TYPE_EXECUTOR) _uninstallExecutor(module, deInitData); - else if (moduleType == MODULE_TYPE_FALLBACK) _uninstallFallbackHandler(module, deInitData); - else if (moduleType == MODULE_TYPE_HOOK) _uninstallHook(module, deInitData); - else revert UnsupportedModuleType(moduleType); - emit ModuleUninstalled(moduleType, module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) _uninstallValidator(module, deInitData); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) _uninstallExecutor(module, deInitData); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) _uninstallFallbackHandler(module, deInitData); + else if (moduleTypeId == MODULE_TYPE_HOOK) _uninstallHook(module, deInitData); + else revert UnsupportedModuleType(moduleTypeId); + emit ModuleUninstalled(moduleTypeId, module); } /** @@ -240,7 +240,7 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { * @inheritdoc IERC7579Account */ function isModuleInstalled( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata additionalContext ) @@ -249,10 +249,10 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { override returns (bool) { - if (moduleType == MODULE_TYPE_VALIDATOR) return _isValidatorInstalled(module); - else if (moduleType == MODULE_TYPE_EXECUTOR) return _isExecutorInstalled(module); - else if (moduleType == MODULE_TYPE_FALLBACK) return _isFallbackHandlerInstalled(module); - else if (moduleType == MODULE_TYPE_HOOK) return _isHookInstalled(module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) return _isValidatorInstalled(module); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) return _isExecutorInstalled(module); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) return _isFallbackHandlerInstalled(module); + else if (moduleTypeId == MODULE_TYPE_HOOK) return _isHookInstalled(module); else return false; } @@ -267,7 +267,7 @@ contract MSAAdvanced is IMSA, ExecutionHelper, ModuleManager, HookManager { /** * @inheritdoc IERC7579Account */ - function supportsAccountMode(ModeCode mode) + function supportsExecutionMode(ModeCode mode) external view virtual diff --git a/src/MSABasic.sol b/src/MSABasic.sol index 6fd37a2..d99a2cd 100644 --- a/src/MSABasic.sol +++ b/src/MSABasic.sol @@ -92,7 +92,7 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { * @inheritdoc IERC7579Account */ function installModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata initData ) @@ -100,18 +100,18 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { payable onlyEntryPointOrSelf { - if (moduleType == MODULE_TYPE_VALIDATOR) _installValidator(module, initData); - else if (moduleType == MODULE_TYPE_EXECUTOR) _installExecutor(module, initData); - else if (moduleType == MODULE_TYPE_FALLBACK) _installFallbackHandler(module, initData); - else revert UnsupportedModuleType(moduleType); - emit ModuleInstalled(moduleType, module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) _installValidator(module, initData); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) _installExecutor(module, initData); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) _installFallbackHandler(module, initData); + else revert UnsupportedModuleType(moduleTypeId); + emit ModuleInstalled(moduleTypeId, module); } /** * @inheritdoc IERC7579Account */ function uninstallModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata deInitData ) @@ -119,11 +119,11 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { payable onlyEntryPointOrSelf { - if (moduleType == MODULE_TYPE_VALIDATOR) _uninstallValidator(module, deInitData); - else if (moduleType == MODULE_TYPE_EXECUTOR) _uninstallExecutor(module, deInitData); - else if (moduleType == MODULE_TYPE_FALLBACK) _uninstallFallbackHandler(module, deInitData); - else revert UnsupportedModuleType(moduleType); - emit ModuleUninstalled(moduleType, module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) _uninstallValidator(module, deInitData); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) _uninstallExecutor(module, deInitData); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) _uninstallFallbackHandler(module, deInitData); + else revert UnsupportedModuleType(moduleTypeId); + emit ModuleUninstalled(moduleTypeId, module); } /** @@ -202,7 +202,7 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { * stored in more complex mappings */ function isModuleInstalled( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata additionalContext ) @@ -211,9 +211,9 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { override returns (bool isInstalled) { - if (moduleType == MODULE_TYPE_VALIDATOR) return _isValidatorInstalled(module); - else if (moduleType == MODULE_TYPE_EXECUTOR) return _isExecutorInstalled(module); - else if (moduleType == MODULE_TYPE_FALLBACK) return _isFallbackHandlerInstalled(module); + if (moduleTypeId == MODULE_TYPE_VALIDATOR) return _isValidatorInstalled(module); + else if (moduleTypeId == MODULE_TYPE_EXECUTOR) return _isExecutorInstalled(module); + else if (moduleTypeId == MODULE_TYPE_FALLBACK) return _isFallbackHandlerInstalled(module); else return false; } @@ -228,7 +228,7 @@ contract MSABasic is IMSA, ExecutionHelper, ModuleManager { /** * @inheritdoc IERC7579Account */ - function supportsAccountMode(ModeCode mode) external view virtual override returns (bool) { + function supportsExecutionMode(ModeCode mode) external view virtual override returns (bool) { CallType callType = mode.getCallType(); if (callType == CALLTYPE_BATCH) return true; else if (callType == CALLTYPE_SINGLE) return true; diff --git a/src/interfaces/IERC7579Account.sol b/src/interfaces/IERC7579Account.sol index 2c161a5..3e9622c 100644 --- a/src/interfaces/IERC7579Account.sol +++ b/src/interfaces/IERC7579Account.sol @@ -85,13 +85,13 @@ interface IERC7579Account { /** * @dev installs a Module of a certain type on the smart account * @dev Implement Authorization control of your chosing - * @param moduleType the module type ID according the ERC-7579 spec + * @param moduleTypeId the module type ID according the ERC-7579 spec * @param module the module address * @param initData arbitrary data that may be required on the module during `onInstall` * initialization. */ function installModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata initData ) @@ -101,13 +101,13 @@ interface IERC7579Account { /** * @dev uninstalls a Module of a certain type on the smart account * @dev Implement Authorization control of your chosing - * @param moduleType the module type ID according the ERC-7579 spec + * @param moduleTypeId the module type ID according the ERC-7579 spec * @param module the module address * @param deInitData arbitrary data that may be required on the module during `onUninstall` * de-initialization. */ function uninstallModule( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata deInitData ) @@ -118,7 +118,7 @@ interface IERC7579Account { * Function to check if the account supports a certain CallType or ExecType (see ModeLib.sol) * @param encodedMode the encoded mode */ - function supportsAccountMode(ModeCode encodedMode) external view returns (bool); + function supportsExecutionMode(ModeCode encodedMode) external view returns (bool); /** * Function to check if the account supports installation of a certain module type Id @@ -128,7 +128,7 @@ interface IERC7579Account { /** * Function to check if the account has a certain module installed - * @param moduleType the module type ID according the ERC-7579 spec + * @param moduleTypeId the module type ID according the ERC-7579 spec * Note: keep in mind that some contracts can be multiple module types at the same time. It * thus may be necessary to query multiple module types * @param module the module address @@ -138,7 +138,7 @@ interface IERC7579Account { * are stored in mappings, this param might be needed */ function isModuleInstalled( - uint256 moduleType, + uint256 moduleTypeId, address module, bytes calldata additionalContext ) diff --git a/src/interfaces/IERC7579Module.sol b/src/interfaces/IERC7579Module.sol index c4bf6f1..b82b552 100644 --- a/src/interfaces/IERC7579Module.sol +++ b/src/interfaces/IERC7579Module.sol @@ -35,11 +35,11 @@ interface IModule { /** * @dev Returns boolean value if module is a certain type - * @param typeID the module type ID according the ERC-7579 spec + * @param moduleTypeId the module type ID according the ERC-7579 spec * * MUST return true if the module is of the given type and false otherwise */ - function isModuleType(uint256 typeID) external view returns (bool); + function isModuleType(uint256 moduleTypeId) external view returns (bool); /** * @dev Returns if the module was already initialized for a provided smartaccount diff --git a/src/interfaces/IMSA.sol b/src/interfaces/IMSA.sol index 6c8d569..b25397e 100644 --- a/src/interfaces/IMSA.sol +++ b/src/interfaces/IMSA.sol @@ -7,7 +7,7 @@ import { CallType, ExecType, ModeCode } from "../lib/ModeLib.sol"; interface IMSA is IERC7579Account { // Error thrown when an unsupported ModuleType is requested - error UnsupportedModuleType(uint256 moduleType); + error UnsupportedModuleType(uint256 moduleTypeId); // Error thrown when an execution with an unsupported CallType was made error UnsupportedCallType(CallType callType); // Error thrown when an execution with an unsupported ExecType was made diff --git a/src/modules/SimpleExecutionValidator.sol b/src/modules/SimpleExecutionValidator.sol index d4c3b46..04942b2 100644 --- a/src/modules/SimpleExecutionValidator.sol +++ b/src/modules/SimpleExecutionValidator.sol @@ -27,8 +27,8 @@ contract SimpleExecutionValidator is IValidator { return _initialized[smartAccount]; } - function isModuleType(uint256 typeID) external view override returns (bool) { - return typeID == MODULE_TYPE_VALIDATOR; + function isModuleType(uint256 moduleTypeId) external view override returns (bool) { + return moduleTypeId == MODULE_TYPE_VALIDATOR; } function validateUserOp( diff --git a/test/mocks/MockExecutor.sol b/test/mocks/MockExecutor.sol index 68689b8..93ae335 100644 --- a/test/mocks/MockExecutor.sol +++ b/test/mocks/MockExecutor.sol @@ -58,8 +58,8 @@ contract MockExecutor is IExecutor { ); } - function isModuleType(uint256 typeID) external view returns (bool) { - return typeID == MODULE_TYPE_EXECUTOR; + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == MODULE_TYPE_EXECUTOR; } function isInitialized(address smartAccount) external view returns (bool) { diff --git a/test/mocks/MockHook.sol b/test/mocks/MockHook.sol index d93d9f7..e3c0d0c 100644 --- a/test/mocks/MockHook.sol +++ b/test/mocks/MockHook.sol @@ -17,8 +17,8 @@ contract MockHook is IHook { { } function postCheck(bytes calldata hookData) external returns (bool success) { } - function isModuleType(uint256 typeID) external view returns (bool) { - return typeID == MODULE_TYPE_HOOK; + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == MODULE_TYPE_HOOK; } function isInitialized(address smartAccount) external view returns (bool) { diff --git a/test/mocks/MockValidator.sol b/test/mocks/MockValidator.sol index e56f19f..b037916 100644 --- a/test/mocks/MockValidator.sol +++ b/test/mocks/MockValidator.sol @@ -37,8 +37,8 @@ contract MockValidator is IValidator { returns (bytes4) { } - function isModuleType(uint256 typeID) external view returns (bool) { - return typeID == MODULE_TYPE_VALIDATOR; + function isModuleType(uint256 moduleTypeId) external view returns (bool) { + return moduleTypeId == MODULE_TYPE_VALIDATOR; } function isInitialized(address smartAccount) external view returns (bool) {