PackedUserOperation
Title: IAccount — ERC-4337 account interface + PackedUserOperation (v0.7+)
Author: Vendored from OpenZeppelin Contracts contracts/interfaces/draft-IERC4337.sol (MIT) and the
ERC-4337 reference (eth-infinitism/account-abstraction). Re-authored to the standard ABI to avoid a GPL dependency. Vendored subset — do not add an account-abstraction dependency.
The account-side surface a smart account exposes to the ERC-4337 EntryPoint. PackedUserOperation
is the v0.7/v0.8 packed struct (NOT ABI-compatible with the v0.6 UserOperation).
Canonical EntryPoints (the trusted msg.sender of validateUserOp): v0.7
0x0000000071727De22E5E9d8BAf0edAc6f37da032, v0.8 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108
(native EIP-7702), v0.9 0x433709009B8330FDa32311DF1C2AFA402eD8D009. Which one is canonical is a
deployment choice — the account stores its EntryPoint rather than hardcoding it.
The packed ERC-4337 v0.7+ user operation.
accountGasLimits = verificationGasLimit (high 128) || callGasLimit (low 128).
gasFees = maxPriorityFeePerGas (high 128) || maxFeePerGas (low 128).
struct PackedUserOperation {
address sender;
uint256 nonce;
bytes initCode;
bytes callData;
bytes32 accountGasLimits;
uint256 preVerificationGas;
bytes32 gasFees;
bytes paymasterAndData;
bytes signature;
}Properties
| Name | Type | Description |
|---|---|---|
| sender | address | |
| nonce | uint256 | |
| initCode | bytes | |
| callData | bytes | |
| accountGasLimits | bytes32 | |
| preVerificationGas | uint256 | |
| gasFees | bytes32 | |
| paymasterAndData | bytes | |
| signature | bytes |