> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stable.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# EIP-7702

> EIP-7702 support on Stable. EOAs can set their account code to an existing smart contract, enabling batch payments, spending limits, and session keys.

Stable supports **EIP-7702**, which allows an EOA to set its account code to an existing smart contract. EOAs keep their original address and private key while executing the delegate's logic.

<Note>
  **Concept:** For what EIP-7702 enables on Stable, the delegation model, and security considerations, see [EIP-7702](/en/explanation/eip-7702). For the full specification, see the [EIP-7702 spec](https://eips.ethereum.org/EIPS/eip-7702).
</Note>

## Transaction format

EIP-7702 uses transaction type `0x04` with an `authorizationList` field. Each authorization designates a delegate contract whose code the EOA executes for that transaction.

```typescript theme={"dark"}
{
  type: 4,
  to: eoa.address,
  data: delegateCallData,
  authorizationList: [signedAuthorization],
  maxPriorityFeePerGas: 0n, // always 0 on Stable
  // ... standard EIP-1559 fields
}
```

The authorization carries:

* `chainId`: must match the target chain.
* `address`: the delegate contract address.
* `nonce`: the authorization nonce (separate from the transaction nonce).

Wallets and libraries that support EIP-7702 handle the authorization format automatically.

## Tooling

* **ethers.js**: `wallet.signAuthorization({ chainId, address, nonce })` produces the signed authorization for inclusion in the `authorizationList`.
* **viem**: use `signAuthorization` with a walletClient, then pass the result to `sendTransaction`.
* **Hardhat / Foundry**: standard EIP-7702 transaction format works when your toolchain version supports the Pectra hardfork.

## Next recommended

<CardGroup cols={2}>
  <Card title="EIP-7702 concept" icon="book-open" href="/en/explanation/eip-7702">
    Understand the delegation model and when to use it.
  </Card>

  <Card title="Account Abstraction (EIP-7702)" icon="zap" href="/en/reference/eip-7702-api">
    Implement batch payments, spending limits, and session keys step by step.
  </Card>
</CardGroup>
