Enhancing Externally Owned Accounts (EOAs) by allowing them to temporarily delegate their execution to smart contracts.
EIP-7702 introduces a new transaction type with TransactionType 0x04.
{
"type": "0x4",
"chainId": number,
"nonce": number,
"gasLimit": string,
"gasPrice": string,
"to": string,
"value": string,
"data": string,
"authorizationList": [
{
"chainId": number,
"address": string,
"nonce": number,
"yParity": number,
"r": string,
"s": string
}
]
}| Field | Type | Description |
|---|---|---|
| chainId | number | The chain ID where the authorization is valid (0 for all chains) |
| address | address | The address of the smart contract code to delegate to |
| nonce | number | The nonce of the signer's account |
| yParity, r, s | signature | The EIP-712 signature components |
The protocol verifies the chain ID, nonce, and validates the authorization signature to ensure authenticity.
The EOA's code is temporarily set to the code of the specified contract address for the duration of the transaction.
The transaction is executed using the logic defined in the delegated smart contract.
Enable gasless transactions by delegating to a paymaster-enabled smart account.
Execute multiple operations (e.g., Approve + Swap) in a single transaction.
Implement custom permissioning, multisig requirements, or time-locked operations.
// Create authorization for EIP-7702
const authorization = {
chainId: 11155111, // Sepolia
contractAddress: '0xe6Cae83BdE06E4c305530e199D7217f42808555B',
nonce: 0
};
// Sign the authorization
const signature = await walletClient.signAuthorization({
...authorization,
account: account
});
// Create EIP-7702 transaction
const transaction = {
type: '0x4',
chainId: 11155111,
from: account.address,
to: targetAddress,
value: '0',
data: '0x',
nonce: await publicClient.getTransactionCount({
address: account.address
}),
authorizationList: [signature]
};