@@ -141,8 +141,12 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
141141
142142 /// @dev Implements Module Enable Mode flow.
143143 /// @param packedData Data source to parse data required to perform Module Enable mode from.
144+ /// @return enableModeSigValid true if the enable mode signature is valid, false otherwise
144145 /// @return userOpSignature the clean signature which can be further used for userOp validation
145- function _enableMode (bytes32 userOpHash , bytes calldata packedData ) internal returns (bytes calldata userOpSignature ) {
146+ function _enableMode (
147+ bytes32 userOpHash ,
148+ bytes calldata packedData
149+ ) internal returns (bool enableModeSigValid , bytes calldata userOpSignature ) {
146150 address module;
147151 uint256 moduleType;
148152 bytes calldata moduleInitData;
@@ -161,9 +165,11 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
161165 validator: enableModeSigValidator
162166 })
163167 ) {
164- revert EnableModeSigError ();
168+ // Review
169+ return (false , userOpSignature);
165170 }
166171 this .installModule {value: msg .value }(moduleType, module, moduleInitData);
172+ return (true , userOpSignature);
167173 }
168174
169175 /// @notice Installs a new module to the smart account.
@@ -578,11 +584,7 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
578584 // Even if the validator doesn't support 7739 under the hood, it is still secure,
579585 // as eip712digest is already built based on 712Domain of this Smart Account
580586 // This interface should always be exposed by validators as per ERC-7579
581- try IValidator (validator).isValidSignatureWithSender (address (this ), eip712Digest, sig) returns (bytes4 res ) {
582- return res == ERC1271_MAGICVALUE ;
583- } catch {
584- return false ;
585- }
587+ return IValidator (validator).isValidSignatureWithSender (address (this ), eip712Digest, sig) == ERC1271_MAGICVALUE ;
586588 }
587589
588590 /// @notice Builds the enable mode data hash as per eip712
0 commit comments