diff --git a/src/module-bases/ERC7579ModuleBase.sol b/src/module-bases/ERC7579ModuleBase.sol index b23b5d92..e7e5ca8f 100644 --- a/src/module-bases/ERC7579ModuleBase.sol +++ b/src/module-bases/ERC7579ModuleBase.sol @@ -2,11 +2,22 @@ pragma solidity >=0.8.0 <0.9.0; import { IModule as IERC7579Module } from "../accounts/common/interfaces/IERC7579Module.sol"; +import { + MODULE_TYPE_VALIDATOR, + MODULE_TYPE_EXECUTOR, + MODULE_TYPE_FALLBACK, + MODULE_TYPE_HOOK, + MODULE_TYPE_POLICY, + MODULE_TYPE_SIGNER, + MODULE_TYPE_STATELESS_VALIDATOR +} from "./utils/ERC7579Constants.sol"; abstract contract ERC7579ModuleBase is IERC7579Module { - uint256 internal constant TYPE_VALIDATOR = 1; - uint256 internal constant TYPE_EXECUTOR = 2; - uint256 internal constant TYPE_FALLBACK = 3; - uint256 internal constant TYPE_HOOK = 4; - uint256 internal constant TYPE_POLICY = 7; + uint256 internal constant TYPE_VALIDATOR = MODULE_TYPE_VALIDATOR; + uint256 internal constant TYPE_EXECUTOR = MODULE_TYPE_EXECUTOR; + uint256 internal constant TYPE_FALLBACK = MODULE_TYPE_FALLBACK; + uint256 internal constant TYPE_HOOK = MODULE_TYPE_HOOK; + uint256 internal constant TYPE_POLICY = MODULE_TYPE_POLICY; + uint256 internal constant TYPE_SIGNER = MODULE_TYPE_SIGNER; + uint256 internal constant TYPE_STATELESS_VALIDATOR = MODULE_TYPE_STATELESS_VALIDATOR; } diff --git a/src/module-bases/mocks/MockHybridValidator.sol b/src/module-bases/mocks/MockHybridValidator.sol index c53c7fb4..fa9a5aeb 100644 --- a/src/module-bases/mocks/MockHybridValidator.sol +++ b/src/module-bases/mocks/MockHybridValidator.sol @@ -37,7 +37,7 @@ contract MockHybridValidator is ERC7579HybridValidatorBase { } function isModuleType(uint256 typeID) external pure override returns (bool) { - return typeID == TYPE_VALIDATOR || typeID == 7; + return typeID == TYPE_VALIDATOR || typeID == TYPE_STATELESS_VALIDATOR; } function isInitialized( diff --git a/src/module-bases/mocks/MockValidator.sol b/src/module-bases/mocks/MockValidator.sol index 2c11be1c..0b77c2ff 100644 --- a/src/module-bases/mocks/MockValidator.sol +++ b/src/module-bases/mocks/MockValidator.sol @@ -38,7 +38,7 @@ contract MockValidator is ERC7579ValidatorBase { } function isModuleType(uint256 typeID) external pure override returns (bool) { - return typeID == TYPE_VALIDATOR || typeID == 7; + return typeID == TYPE_VALIDATOR; } function isInitialized( diff --git a/src/module-bases/utils/ERC7579Constants.sol b/src/module-bases/utils/ERC7579Constants.sol new file mode 100644 index 00000000..7f927857 --- /dev/null +++ b/src/module-bases/utils/ERC7579Constants.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: AGPL-3.0-only +pragma solidity >=0.8.0 <0.9.0; + +uint256 constant MODULE_TYPE_VALIDATOR = 1; +uint256 constant MODULE_TYPE_EXECUTOR = 2; +uint256 constant MODULE_TYPE_FALLBACK = 3; +uint256 constant MODULE_TYPE_HOOK = 4; +uint256 constant MODULE_TYPE_POLICY = 5; +uint256 constant MODULE_TYPE_SIGNER = 6; +uint256 constant MODULE_TYPE_STATELESS_VALIDATOR = 7;