@@ -13,17 +13,18 @@ import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet
1313import {collectReturnData} from "../helpers/CollectReturnData.sol " ;
1414import {DIRECT_CALL_VALIDATION_ENTITY_ID} from "../helpers/Constants.sol " ;
1515import {_coalescePreValidation, _coalesceValidation} from "../helpers/ValidationResHelpers.sol " ;
16- import {IExecutionHookModule} from "../interfaces/IExecutionHookModule.sol " ;
17- import {ExecutionManifest} from "../interfaces/IExecutionModule.sol " ;
16+
1817import {
1918 Call,
20- IModularAccount ,
19+ IERC6900Account ,
2120 ModuleEntity,
2221 ValidationConfig,
2322 ValidationFlags
24- } from "../interfaces/IModularAccount.sol " ;
25- import {IValidationHookModule} from "../interfaces/IValidationHookModule.sol " ;
26- import {IValidationModule} from "../interfaces/IValidationModule.sol " ;
23+ } from "../interfaces/IERC6900Account.sol " ;
24+ import {IERC6900ExecutionHookModule } from "../interfaces/IERC6900ExecutionHookModule.sol " ;
25+ import {ExecutionManifest} from "../interfaces/IERC6900ExecutionModule.sol " ;
26+ import {IERC6900ValidationHookModule } from "../interfaces/IERC6900ValidationHookModule.sol " ;
27+ import {IERC6900ValidationModule } from "../interfaces/IERC6900ValidationModule.sol " ;
2728import {HookConfig, HookConfigLib} from "../libraries/HookConfigLib.sol " ;
2829import {ModuleEntityLib} from "../libraries/ModuleEntityLib.sol " ;
2930import {SparseCalldataSegmentLib} from "../libraries/SparseCalldataSegmentLib.sol " ;
@@ -35,7 +36,7 @@ import {ModularAccountView} from "./ModularAccountView.sol";
3536import {ModuleManagerInternals} from "./ModuleManagerInternals.sol " ;
3637
3738contract ReferenceModularAccount is
38- IModularAccount ,
39+ IERC6900Account ,
3940 AccountExecutor ,
4041 ModularAccountView ,
4142 AccountStorageInitializable ,
@@ -159,7 +160,7 @@ contract ReferenceModularAccount is
159160 _doCachedPostExecHooks (postValidatorExecHooks);
160161 }
161162
162- /// @inheritdoc IModularAccount
163+ /// @inheritdoc IERC6900Account
163164 /// @notice May be validated by a global validation.
164165 function execute (address target , uint256 value , bytes calldata data )
165166 external
@@ -171,7 +172,7 @@ contract ReferenceModularAccount is
171172 result = _exec (target, value, data);
172173 }
173174
174- /// @inheritdoc IModularAccount
175+ /// @inheritdoc IERC6900Account
175176 /// @notice May be validated by a global validation function.
176177 function executeBatch (Call[] calldata calls )
177178 external
@@ -188,7 +189,7 @@ contract ReferenceModularAccount is
188189 }
189190 }
190191
191- /// @inheritdoc IModularAccount
192+ /// @inheritdoc IERC6900Account
192193 function executeWithRuntimeValidation (bytes calldata data , bytes calldata authorization )
193194 external
194195 payable
@@ -225,7 +226,7 @@ contract ReferenceModularAccount is
225226 return returnData;
226227 }
227228
228- /// @inheritdoc IModularAccount
229+ /// @inheritdoc IERC6900Account
229230 /// @notice May be validated by a global validation.
230231 function installExecution (
231232 address module ,
@@ -235,7 +236,7 @@ contract ReferenceModularAccount is
235236 _installExecution (module, manifest, moduleInstallData);
236237 }
237238
238- /// @inheritdoc IModularAccount
239+ /// @inheritdoc IERC6900Account
239240 /// @notice May be validated by a global validation.
240241 function uninstallExecution (
241242 address module ,
@@ -256,7 +257,7 @@ contract ReferenceModularAccount is
256257 _installValidation (validationConfig, selectors, installData, hooks);
257258 }
258259
259- /// @inheritdoc IModularAccount
260+ /// @inheritdoc IERC6900Account
260261 /// @notice May be validated by a global validation.
261262 /// @dev This function can be used to update (to a certain degree) previously installed validation functions.
262263 /// - preValidationHook, executionHooks, and selectors can be added later. Though they won't be deleted.
@@ -270,7 +271,7 @@ contract ReferenceModularAccount is
270271 _installValidation (validationConfig, selectors, installData, hooks);
271272 }
272273
273- /// @inheritdoc IModularAccount
274+ /// @inheritdoc IERC6900Account
274275 /// @notice May be validated by a global validation.
275276 function uninstallValidation (
276277 ModuleEntity validationFunction ,
@@ -295,7 +296,7 @@ contract ReferenceModularAccount is
295296 return getAccountStorage ().supportedIfaces[interfaceId] > 0 ;
296297 }
297298
298- /// @inheritdoc IModularAccount
299+ /// @inheritdoc IERC6900Account
299300 function accountId () external pure virtual returns (string memory ) {
300301 return "erc6900.reference-modular-account.0.8.0 " ;
301302 }
@@ -328,7 +329,7 @@ contract ReferenceModularAccount is
328329 (currentSignatureSegment, signature) = signature.advanceSegmentIfAtIndex (uint8 (i));
329330
330331 // If this reverts, bubble up revert reason.
331- IValidationHookModule (hookModule).preSignatureValidationHook (
332+ IERC6900ValidationHookModule (hookModule).preSignatureValidationHook (
332333 hookEntityId, msg .sender , hash, currentSignatureSegment
333334 );
334335 }
@@ -398,7 +399,7 @@ contract ReferenceModularAccount is
398399
399400 (address module , uint32 entityId ) = preUserOpValidationHooks[i].moduleEntity ().unpack ();
400401 uint256 currentValidationRes =
401- IValidationHookModule (module).preUserOpValidationHook (entityId, userOp, userOpHash);
402+ IERC6900ValidationHookModule (module).preUserOpValidationHook (entityId, userOp, userOpHash);
402403
403404 if (uint160 (currentValidationRes) > 1 ) {
404405 // If the aggregator is not 0 or 1, it is an unexpected value
@@ -486,7 +487,7 @@ contract ReferenceModularAccount is
486487 returns (bytes memory preExecHookReturnData )
487488 {
488489 (address module , uint32 entityId ) = preExecHook.unpack ();
489- try IExecutionHookModule (module).preExecutionHook (entityId, msg .sender , msg .value , data) returns (
490+ try IERC6900ExecutionHookModule (module).preExecutionHook (entityId, msg .sender , msg .value , data) returns (
490491 bytes memory returnData
491492 ) {
492493 preExecHookReturnData = returnData;
@@ -511,12 +512,14 @@ contract ReferenceModularAccount is
511512 }
512513
513514 (address module , uint32 entityId ) = postHookToRun.postExecHook.unpack ();
514- // solhint-disable-next-line no-empty-blocks
515- try IExecutionHookModule (module).postExecutionHook (entityId, postHookToRun.preExecHookReturnData) {}
516- catch {
515+ /* solhint-disable no-empty-blocks */
516+ try IERC6900ExecutionHookModule (module).postExecutionHook (
517+ entityId, postHookToRun.preExecHookReturnData
518+ ) {} catch {
517519 bytes memory revertReason = collectReturnData ();
518520 revert PostExecHookReverted (module, entityId, revertReason);
519521 }
522+ /* solhint-enable no-empty-blocks */
520523 }
521524 }
522525
@@ -526,7 +529,7 @@ contract ReferenceModularAccount is
526529 bytes memory currentAuthData
527530 ) internal {
528531 (address hookModule , uint32 hookEntityId ) = validationHook.unpack ();
529- try IValidationHookModule (hookModule).preRuntimeValidationHook (
532+ try IERC6900ValidationHookModule (hookModule).preRuntimeValidationHook (
530533 hookEntityId, msg .sender , msg .value , callData, currentAuthData
531534 )
532535 // forgefmt: disable-start
@@ -608,7 +611,7 @@ contract ReferenceModularAccount is
608611 revert UserOpValidationInvalid (module, entityId);
609612 }
610613
611- return IValidationModule (module).validateUserOp (entityId, userOp, userOpHash);
614+ return IERC6900ValidationModule (module).validateUserOp (entityId, userOp, userOpHash);
612615 }
613616
614617 function _execRuntimeValidation (
@@ -618,7 +621,7 @@ contract ReferenceModularAccount is
618621 ) internal virtual {
619622 (address module , uint32 entityId ) = runtimeValidationFunction.unpack ();
620623
621- try IValidationModule (module).validateRuntime (
624+ try IERC6900ValidationModule (module).validateRuntime (
622625 address (this ), entityId, msg .sender , msg .value , callData, authorization
623626 )
624627 // forgefmt: disable-start
@@ -644,8 +647,9 @@ contract ReferenceModularAccount is
644647 }
645648
646649 if (
647- IValidationModule (module).validateSignature (address (this ), entityId, msg .sender , hash, signature)
648- == _1271_MAGIC_VALUE
650+ IERC6900ValidationModule (module).validateSignature (
651+ address (this ), entityId, msg .sender , hash, signature
652+ ) == _1271_MAGIC_VALUE
649653 ) {
650654 return _1271_MAGIC_VALUE;
651655 }
@@ -684,15 +688,15 @@ contract ReferenceModularAccount is
684688
685689 _checkIfValidationAppliesSelector (outerSelector, validationFunction, checkingType);
686690
687- if (outerSelector == IModularAccount .execute.selector ) {
691+ if (outerSelector == IERC6900Account .execute.selector ) {
688692 (address target ,,) = abi.decode (callData[4 :], (address , uint256 , bytes ));
689693
690694 if (target == address (this )) {
691695 // There is no point to call `execute` to recurse exactly once - this is equivalent to just having
692696 // the calldata as a top-level call.
693697 revert SelfCallRecursionDepthExceeded ();
694698 }
695- } else if (outerSelector == IModularAccount .executeBatch.selector ) {
699+ } else if (outerSelector == IERC6900Account .executeBatch.selector ) {
696700 // executeBatch may be used to batch account actions together, by targetting the account itself.
697701 // If this is done, we must ensure all of the inner calls are allowed by the provided validation
698702 // function.
@@ -704,8 +708,8 @@ contract ReferenceModularAccount is
704708 bytes4 nestedSelector = bytes4 (calls[i].data);
705709
706710 if (
707- nestedSelector == IModularAccount .execute.selector
708- || nestedSelector == IModularAccount .executeBatch.selector
711+ nestedSelector == IERC6900Account .execute.selector
712+ || nestedSelector == IERC6900Account .executeBatch.selector
709713 ) {
710714 // To prevent arbitrarily-deep recursive checking, we limit the depth of self-calls to one
711715 // for the purposes of batching.
0 commit comments