Smart Account (ERC-4337) UserOp Builder
Build an ERC-4337 UserOperation for EntryPoint v0.6 or v0.7 and see its JSON, packed encoding, and UserOpHash.
How to use the Smart Account (ERC-4337) UserOp Builder
- Pick v0.6 or v0.7 from the EntryPoint Version selector — the tool defaults to v0.7.
- Fill in Sender, Nonce, Call Data, the three gas limit fields, and the two fee fields (in Gwei) — the tool is prefilled with a working example so all outputs render immediately.
- If a field is invalid, an alert names the offending field and the output panels are hidden until it's fixed.
- Open Factory (account deployment) (labeled Init Code (account deployment) in v0.6) only when this UserOperation deploys a new smart account; open Paymaster only when a paymaster sponsors gas. Leaving either closed/blank omits those fields from the built UserOperation.
- In the UserOpHash panel, set the Chain ID and EntryPoint Address (defaults to the canonical address for whichever version is selected, and updates automatically when you switch versions unless you've typed a custom address) to compute the exact hash that would need to be signed.
- Each panel has its own Copy button; the PackedUserOperation panel only appears for v0.7.
How This Tool Works
Pick EntryPoint v0.6 or v0.7 from the version selector, then fill in the Sender, Nonce, Call Data, gas limit, and fee fields — the UserOperation JSON and UserOpHash panels update instantly as you type, with no debounce. A PackedUserOperation panel also appears for v0.7, which has a packed on-chain representation; v0.6 doesn't, so that panel is hidden in v0.6 mode.
Open the Factory/Init Code or Paymaster sections only if this UserOperation deploys a new account or uses a paymaster — leaving them blank omits those fields entirely, matching a normal already-deployed, self-paying account. Which fields appear there matches whichever EntryPoint version is selected.
Set the Chain ID and EntryPoint address in the UserOpHash panel to compute the exact hash a smart account would need to sign — switching versions updates the EntryPoint address to that version's canonical default automatically, unless you've typed a custom one.