Skip to content

Commit

Permalink
chore: add hook data format
Browse files Browse the repository at this point in the history
  • Loading branch information
howydev committed Sep 5, 2024
1 parent 42de32c commit 2ecdb6c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions standard/ERCs/erc-6900.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ interface IExecutionHookModule is IModule {
/// be more than one.
/// @param sender The caller address.
/// @param value The call value.
/// @param data The calldata sent. For `executeUserOp` calls on the account, hook modules would receive the full msg.data.
/// @param data The calldata sent. For `executeUserOp` calls, hook modules should receive the full msg.data.
/// @return Context to pass to a post execution hook, if present. An empty bytes array MAY be returned.
function preExecutionHook(uint32 entityId, address sender, uint256 value, bytes calldata data)
external
Expand Down Expand Up @@ -512,7 +512,19 @@ During execution uninstallation, the account MUST correctly clear flags and othe
- the account SHOULD call `onUnInstall` on the execution module to initialize the states and track call success if required by user.
- the account MUST emit `ExecutionUninstalled` as defined in the interface for all uninstalled executions.

### Hook Execution Order
### Hooks

#### Execution Hooks data format

It is RECOMMENDED for accounts to support execution hooks associated with a validation function for accounts to apply additional permissions on different validation functions.

For accounts that implement execution hooks, accounts **MUST** conform to these execution hook formats:
1. For `executeUserOp` calls, for execution hooks associated with a validator, accounts **MUST** send the full `msg.data`, including the `executeUserOp` selector.
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`.
3. For `executeWithAuthorization` calls, for all execution hooks, accounts **MUST** send the inner `data`.
4. For all other calls, for execution hooks associated with a selector, accounts **MUST** send over `msg.data`.

#### Hook Execution Order

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

Expand Down

0 comments on commit 2ecdb6c

Please sign in to comment.