LayerZeroFault
← Return to Hub / Passkey Recovery / Diagnostic Tools

ERC-4337 UserOp & Calldata Decoder

Debug Account Abstraction transactions before broadcast. Unpack EntryPoint v0.6 and v0.7 structs, calculate required prefund balances, decode smart wallet calldata, and isolate AA21, AA23, and AA33 revert conditions.

100% Client-Side Sandbox Decoding

All user operations and hexadecimal calldata strings are parsed locally in your browser memory. No payload details, account addresses, or signatures are transmitted over any external network.

v0.6 / v0.7 Auto-Detect

EntryPoint Diagnostic Codes

AA21: Account balance below calculated required prefund.
AA22: Expired or not yet valid signature timestamp (clock drift).
AA23: UserOp validation reverted in account contract or verificationGas exhausted.
AA33: Paymaster postOp reverted or gas limit insufficient.
Awaiting UserOperation Input

Paste a JSON struct or hex string to inspect parameters.

STANDBY
Max Prefund Required 0.0000 ETH 0 Gwei
Total Gas Overhead 0 Gas V: 0 | C: 0 | P: 0
Max Fee Per Gas 0.00 Gwei Priority: 0.00 Gwei
Field Decoded Value Decimal / Note
No operation loaded. Paste UserOp JSON on the left.

Understanding ERC-4337 Prefund & Validation Mechanics

How EntryPoint Calculates Required Prefund

Before the EntryPoint contract invokes your smart account's validateUserOp function, it demands an upfront collateral deposit known as the prefund. On EntryPoint v0.6 and v0.7, this is calculated as:

requiredPrefund = (
  verificationGasLimit * (paymaster ? 3 : 1) + 
  callGasLimit + 
  preVerificationGas
) * maxFeePerGas

If the account's EntryPoint deposit (or native balance for self-paying accounts) is less than this theoretical worst-case amount, the transaction immediately reverts with AA21 didn't pay prefund without even attempting verification.

EntryPoint v0.6 vs v0.7 Structural Differences

EntryPoint v0.7 reorganized the UserOperation struct to optimize calldata packing on Layer 2 rollups (Arbitrum, Base, Optimism):

  • accountGasLimits: Combines verificationGasLimit (high 16 bytes) and callGasLimit (low 16 bytes) into a single bytes32.
  • gasFees: Combines maxPriorityFeePerGas and maxFeePerGas into a single bytes32.
  • paymasterAndData: Replaced by dedicated paymaster, paymasterVerificationGasLimit, paymasterPostOpGasLimit, and paymasterData.