Skip to content

Commit 2ecdb6c

Browse files
committed
chore: add hook data format
1 parent 42de32c commit 2ecdb6c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

standard/ERCs/erc-6900.md

Lines changed: 14 additions & 2 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. For `executeUserOp` calls on the account, hook modules would receive the full msg.data.
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,19 @@ 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+
It is RECOMMENDED for accounts to support execution hooks associated with a validation function for accounts to apply additional permissions on different validation functions.
520+
521+
For accounts that implement execution hooks, accounts **MUST** conform to these execution hook formats:
522+
1. For `executeUserOp` calls, for execution hooks associated with a validator, accounts **MUST** send the full `msg.data`, including the `executeUserOp` selector.
523+
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`.
524+
3. For `executeWithAuthorization` calls, for all execution hooks, accounts **MUST** send the inner `data`.
525+
4. For all other calls, for execution hooks associated with a selector, accounts **MUST** send over `msg.data`.
526+
527+
#### Hook Execution Order
516528

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

0 commit comments

Comments
 (0)