Skip to content

Commit cc5ac05

Browse files
authored
chore: add requirements for IAccountExecute (#180)
1 parent 79333fa commit cc5ac05

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

standard/ERCs/erc-6900.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ interface IExecutionHookModule is IModule {
444444
/// be more than one.
445445
/// @param sender The caller address.
446446
/// @param value The call value.
447-
/// @param data The calldata sent.
447+
/// @param data The calldata sent. For `executeUserOp` calls, hook modules should receive the full msg.data.
448448
/// @return Context to pass to a post execution hook, if present. An empty bytes array MAY be returned.
449449
function preExecutionHook(uint32 entityId, address sender, uint256 value, bytes calldata data)
450450
external
@@ -512,7 +512,17 @@ During execution uninstallation, the account MUST correctly clear flags and othe
512512
- the account SHOULD call `onUnInstall` on the execution module to initialize the states and track call success if required by user.
513513
- the account MUST emit `ExecutionUninstalled` as defined in the interface for all uninstalled executions.
514514

515-
### Hook Execution Order
515+
### Hooks
516+
517+
#### Execution Hooks Data Format
518+
519+
For accounts that implement execution hooks, accounts MUST conform to these execution hook formats:
520+
1. For `executeUserOp` calls, for execution hooks associated with a validation function, accounts MUST send the full `msg.data`, including the `executeUserOp` selector.
521+
2. For `executeUserOp` calls, for execution hooks associated with a selector, accounts MUST send `PackedUserOperation.callData` for `executeUserOp` calls, excluding `executeUserOp.selector` and the rest of the `PackedUserOperation`.
522+
3. For `executeWithAuthorization` calls, for all execution hooks, accounts MUST send the inner `data`.
523+
4. For all other calls, for execution hooks associated with a selector, accounts MUST send over `msg.data`.
524+
525+
#### Hook Execution Order
516526

517527
It is RECOMMENDED that an account implementer runs hooks in first installed first executed order. However, an account MAY implement a different execution order.
518528

@@ -540,7 +550,7 @@ If the selector being checked is `execute` or `executeBatch`, the modular accoun
540550

541551
Installed validations have two flag variables indicating what they may be used for. If a validation is attempted to be used for user op validation and the flag `isUserOpValidation` is set to false, validation MUST revert. If the validation is attempted to be used for signature validation and the flag `isSignatureValidation` is set to false, validation MUST revert.
542552

543-
#### Direct Call Validation.
553+
#### Direct Call Validation
544554

545555
If a validation function is installed with the entity ID of `0xffffffff`, it may be used as direct call validation. This occurs when a module or other address calls a function on the modular account, without wrapping its call in the dispatcher function `executeWithAuthorization` to use as a selection mechanism for a runtime validation function.
546556

0 commit comments

Comments
 (0)