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 57e4656
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 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,17 @@ 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

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 57e4656

Please sign in to comment.