# Building with Account Abstraction

Igra supports both EIP-7702 (protocol-level EOA delegation) and ERC-4337 (smart accounts). Prague/Pectra is active from genesis.

## What's Available

| Feature                        | Status    | Requires                            |
| ------------------------------ | --------- | ----------------------------------- |
| EIP-7702 atomic batching       | Works now | Nothing — protocol-level            |
| ERC-4337 smart accounts        | Works now | EntryPoint + Factory deployed       |
| Gas sponsorship (paymaster)    | Not yet   | VerifyingPaymaster + bundler needed |
| Session keys / spending limits | Works now | Via Simple7702Account delegation    |

## EIP-7702 — Batch Transactions from Any EOA

Send a type-4 transaction that delegates an EOA to Simple7702Account and batches multiple calls in one atomic tx. No smart account deployment needed.

```javascript
// Example: EOA delegates to Simple7702Account for one tx
// Approve token + swap on DEX in a single atomic transaction
// No smart account deployment needed

const authorization = {
  chainId: 38833,
  address: "0x4Cd241E8d1510e30b2076397afc7508Ae59C66c9", // Simple7702Account
  nonce: await provider.getTransactionCount(wallet.address),
};

// Sign authorization with EOA
const signedAuth = await wallet.signAuthorization(authorization);

// Send type-4 tx with batched calls
const tx = await wallet.sendTransaction({
  type: 4,
  authorizationList: [signedAuth],
  to: wallet.address, // calls execute on your own EOA (now delegated)
  data: encodeBatchedCalls([approveCall, swapCall]),
  gasPrice: ethers.parseUnits("1100", "gwei"),
});
```

## ERC-4337 — Create a Smart Account

Deploy a smart account via SimpleAccountFactory:

```javascript
const factory = new ethers.Contract(
  "0x13E9ed32155810FDbd067D4522C492D6f68E5944",
  ["function createAccount(address owner, uint256 salt) returns (address)"],
  wallet
);

const tx = await factory.createAccount(ownerAddress, 0, {
  gasPrice: ethers.parseUnits("1100", "gwei"),
});
```

## Reference

* [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) — Account Abstraction Using Alt Mempool
* [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) — Set EOA account code
* [Contract Addresses](https://igra-labs.gitbook.io/igralabs-docs/for-developers/contract-addresses/account-abstraction) — Deployed contracts and ABIs


---

# 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://igra-labs.gitbook.io/igralabs-docs/for-developers/building-with-account-abstraction.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.
