@@ -84,13 +84,13 @@ contract ReferenceModularAccount is
8484 // Wraps execution of a native function with runtime validation and hooks
8585 // Used for upgradeTo, upgradeToAndCall, execute, executeBatch, installExecution, uninstallExecution
8686 modifier wrapNativeFunction () {
87- (PostExecToRun[] memory postPermissionHooks , PostExecToRun[] memory postExecHooks ) =
87+ (PostExecToRun[] memory postValidatorExecHooks , PostExecToRun[] memory postSelectorExecHooks ) =
8888 _checkPermittedCallerAndAssociatedHooks ();
8989
9090 _;
9191
92- _doCachedPostExecHooks (postExecHooks );
93- _doCachedPostExecHooks (postPermissionHooks );
92+ _doCachedPostExecHooks (postSelectorExecHooks );
93+ _doCachedPostExecHooks (postValidatorExecHooks );
9494 }
9595
9696 constructor (IEntryPoint anEntryPoint ) {
@@ -110,7 +110,7 @@ contract ReferenceModularAccount is
110110 if (execModule == address (0 )) {
111111 revert UnrecognizedFunction (msg .sig );
112112 }
113- (PostExecToRun[] memory postPermissionHooks , PostExecToRun[] memory postExecHooks ) =
113+ (PostExecToRun[] memory postValidatorExecHooks , PostExecToRun[] memory postSelectorExecHooks ) =
114114 _checkPermittedCallerAndAssociatedHooks ();
115115
116116 // execute the function, bubbling up any reverts
@@ -123,8 +123,8 @@ contract ReferenceModularAccount is
123123 }
124124 }
125125
126- _doCachedPostExecHooks (postExecHooks );
127- _doCachedPostExecHooks (postPermissionHooks );
126+ _doCachedPostExecHooks (postSelectorExecHooks );
127+ _doCachedPostExecHooks (postValidatorExecHooks );
128128
129129 return execReturnData;
130130 }
@@ -139,8 +139,8 @@ contract ReferenceModularAccount is
139139
140140 ModuleEntity userOpValidationFunction = ModuleEntity.wrap (bytes24 (userOp.signature[:24 ]));
141141
142- PostExecToRun[] memory postPermissionHooks =
143- _doPreHooks (getAccountStorage ().validationData[userOpValidationFunction].permissionHooks , msg .data );
142+ PostExecToRun[] memory postValidatorExecHooks =
143+ _doPreHooks (getAccountStorage ().validationData[userOpValidationFunction].executionHooks , msg .data );
144144
145145 (bool success , bytes memory result ) = address (this ).call (userOp.callData[4 :]);
146146
@@ -151,7 +151,7 @@ contract ReferenceModularAccount is
151151 }
152152 }
153153
154- _doCachedPostExecHooks (postPermissionHooks );
154+ _doCachedPostExecHooks (postValidatorExecHooks );
155155 }
156156
157157 /// @inheritdoc IModularAccount
@@ -202,9 +202,9 @@ contract ReferenceModularAccount is
202202
203203 _doRuntimeValidation (runtimeValidationFunction, data, authorization[25 :]);
204204
205- // If runtime validation passes, do runtime permission checks
206- PostExecToRun[] memory postPermissionHooks =
207- _doPreHooks (getAccountStorage ().validationData[runtimeValidationFunction].permissionHooks , data);
205+ // If runtime validation passes, run exec hooks associated with the validator
206+ PostExecToRun[] memory postValidatorExecHooks =
207+ _doPreHooks (getAccountStorage ().validationData[runtimeValidationFunction].executionHooks , data);
208208
209209 // Execute the call
210210 (bool success , bytes memory returnData ) = address (this ).call (data);
@@ -215,7 +215,7 @@ contract ReferenceModularAccount is
215215 }
216216 }
217217
218- _doCachedPostExecHooks (postPermissionHooks );
218+ _doCachedPostExecHooks (postValidatorExecHooks );
219219
220220 return returnData;
221221 }
@@ -254,7 +254,7 @@ contract ReferenceModularAccount is
254254 /// @inheritdoc IModularAccount
255255 /// @notice May be validated by a global validation.
256256 /// @dev This function can be used to update (to a certain degree) previously installed validation functions.
257- /// - preValidationHook, permissionHook , and selectors can be added later. Though they won't be deleted.
257+ /// - preValidationHook, executionHooks , and selectors can be added later. Though they won't be deleted.
258258 /// - isGlobal and isSignatureValidation can also be updated later.
259259 function installValidation (
260260 ValidationConfig validationConfig ,
@@ -360,12 +360,12 @@ contract ReferenceModularAccount is
360360 isGlobalValidation ? ValidationCheckingType.GLOBAL : ValidationCheckingType.SELECTOR
361361 );
362362
363- // Check if there are permission hooks associated with the validator, and revert if the call isn't to
363+ // Check if there are execution hooks associated with the validator, and revert if the call isn't to
364364 // `executeUserOp`
365365 // This check must be here because if context isn't passed, we can't tell in execution which hooks should
366366 // have ran
367367 if (
368- getAccountStorage ().validationData[userOpValidationFunction].permissionHooks .length () > 0
368+ getAccountStorage ().validationData[userOpValidationFunction].executionHooks .length () > 0
369369 && bytes4 (userOp.callData[:4 ]) != this .executeUserOp.selector
370370 ) {
371371 revert RequireUserOperationContext ();
@@ -538,24 +538,24 @@ contract ReferenceModularAccount is
538538 /**
539539 * Order of operations:
540540 * 1. Check if the sender is the entry point, the account itself, or the selector called is public.
541- * - Yes: Return an empty array, there are no post permissionHooks .
541+ * - Yes: Return an empty array, there are no post executionHooks .
542542 * - No: Continue
543543 * 2. Check if the called selector (msg.sig) is included in the set of selectors the msg.sender can
544544 * directly call.
545545 * - Yes: Continue
546546 * - No: Revert, the caller is not allowed to call this selector
547547 * 3. If there are runtime validation hooks associated with this caller-sig combination, run them.
548- * 4. Run the pre permissionHooks associated with this caller-sig combination, and return the
549- * post permissionHooks to run later.
548+ * 4. Run the pre executionHooks associated with this caller-sig combination, and return the
549+ * post executionHooks to run later.
550550 */
551551 function _checkPermittedCallerAndAssociatedHooks ()
552552 internal
553553 returns (PostExecToRun[] memory , PostExecToRun[] memory )
554554 {
555555 AccountStorage storage _storage = getAccountStorage ();
556- PostExecToRun[] memory postPermissionHooks ;
556+ PostExecToRun[] memory postValidatorExecutionHooks ;
557557
558- // We only need to handle permission hooks when the sender is not the entry point or the account itself,
558+ // We only need to handle execution hooks when the sender is not the entry point or the account itself,
559559 // and the selector isn't public.
560560 if (
561561 msg .sender != address (_ENTRY_POINT) && msg .sender != address (this )
@@ -566,7 +566,7 @@ contract ReferenceModularAccount is
566566
567567 _checkIfValidationAppliesCallData (msg .data , directCallValidationKey, ValidationCheckingType.EITHER);
568568
569- // Direct call is allowed, run associated permission & validation hooks
569+ // Direct call is allowed, run associated execution & validation hooks
570570
571571 // Validation hooks
572572 ModuleEntity[] memory preRuntimeValidationHooks =
@@ -577,16 +577,16 @@ contract ReferenceModularAccount is
577577 _doPreRuntimeValidationHook (preRuntimeValidationHooks[i], msg .data , "" );
578578 }
579579
580- // Permission hooks
581- postPermissionHooks =
582- _doPreHooks (_storage.validationData[directCallValidationKey].permissionHooks , msg .data );
580+ // Execution hooks associated with the validator
581+ postValidatorExecutionHooks =
582+ _doPreHooks (_storage.validationData[directCallValidationKey].executionHooks , msg .data );
583583 }
584584
585- // Exec hooks
586- PostExecToRun[] memory postExecutionHooks =
585+ // Exec hooks associated with the selector
586+ PostExecToRun[] memory postSelectorExecutionHooks =
587587 _doPreHooks (_storage.executionData[msg .sig ].executionHooks, msg .data );
588588
589- return (postPermissionHooks, postExecutionHooks );
589+ return (postValidatorExecutionHooks, postSelectorExecutionHooks );
590590 }
591591
592592 function _execUserOpValidation (
0 commit comments