Operations
There are several main components to ERC-4337: UserOperations, Bundler, EntryPoint Contract, Account Contract, Account Factory Contract and Paymaster Contract.
Last updated
There are several main components to ERC-4337: UserOperations, Bundler, EntryPoint Contract, Account Contract, Account Factory Contract and Paymaster Contract.
Last updated
UserOperation
: are pseudo-transaction objects that are used to execute transactions with contract accounts.
These are created by the dapp. Wallets should be able to translate regular transactions into UserOperation
so dapps' frontends don't need to change anything to support ERC-4337 .
Bundlers
: are actors that package UserOperations from a mempool and send them to the EntryPoint contract on the blockchain.
EntryPoint
: is a smart contract that handles the verification and execution logic for transactions. Account Contracts are smart contract accounts owned by a user.
Account Contract
: is the smart contract wallet of a user.
Factory Contract
: When using a wallet for the first time, the initCode
field of the UserOperation
is used to specify creation of the smart contract wallet.
Paymaster Contracts
: are optional smart contract accounts that can sponsor gas fees for Account Contracts, or allow their owners to pay for those fees with ERC-20 tokens instead of ETH.
The lifecycle of transition looks like this:
UserOperation
are pseudo-transaction objects that are used to execute transactions with contract accounts.
These are created by the dapp. Wallets should be able to translate regular transactions into UserOperation
so dapps' frontends don't need to change anything to support ERC-4337.
Field | Type | Description |
---|---|---|
|
| The address of the smart contract account |
|
| Anti-replay protection; also used as the salt for first-time account creation |
|
| Code used to deploy the account if not yet on-chain |
|
| Data that's passed to the sender for execution |
|
| Gas limit for execution phase |
|
| Gas limit for verification phase |
|
| Gas to compensate the bundler |
|
| Maximum fee per gas (similar to EIP-1559(opens in a new tab) |
|
| Maximum priority fee per gas (similar to EIP-1559 |
|
| Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction) |
|
| Used to validate a UserOperation along with the nonce during verification |