# Operations

* **`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. &#x20;
* **`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:

<figure><img src="https://2952380122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuD7AmV6zHVSdf9W2Sjm4%2Fuploads%2FPWgaSiOemetV2kCNMhlu%2F4337%20Submit%20UserOperation%20to%20bundler.08324fee.svg?alt=media&#x26;token=443f8e6f-7ebb-4357-bad3-16b5a93beb56" alt=""><figcaption><p><a href="https://www.erc4337.io/docs/understanding-ERC-4337/architecture">Source</a></p></figcaption></figure>

## UserOperation

`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.

<table data-full-width="false"><thead><tr><th width="276">Field</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>sender</code></td><td><code>address</code></td><td>The address of the smart contract account</td></tr><tr><td><code>nonce</code></td><td><code>uint256</code></td><td>Anti-replay protection; also used as the salt for first-time account creation</td></tr><tr><td><code>initCode</code></td><td><code>bytes</code></td><td>Code used to deploy the account if not yet on-chain</td></tr><tr><td><code>callData</code></td><td><code>bytes</code></td><td>Data that's passed to the sender for execution</td></tr><tr><td><code>callGasLimit</code></td><td><code>uint256</code></td><td>Gas limit for execution phase</td></tr><tr><td><code>verificationGasLimit</code></td><td><code>uint256</code></td><td>Gas limit for verification phase</td></tr><tr><td><code>preVerificationGas</code></td><td><code>uint256</code></td><td>Gas to compensate the bundler</td></tr><tr><td><code>maxFeePerGas</code></td><td><code>uint256</code></td><td>Maximum fee per gas (similar to <a href="https://eips.ethereum.org/EIPS/eip-1559">EIP-1559(opens in a new tab)</a> <code>max_fee_per_gas</code>)</td></tr><tr><td><code>maxPriorityFeePerGas</code></td><td><code>uint256</code></td><td>Maximum priority fee per gas (similar to EIP-1559 <code>max_priority_fee_per_gas</code>)</td></tr><tr><td><code>paymasterAndData</code></td><td><code>bytes</code></td><td>Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction)</td></tr><tr><td><code>signature</code></td><td><code>bytes</code></td><td>Used to validate a UserOperation along with the nonce during verification</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.epochprotocol.xyz/account-abstraction/erc-4337/operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
