Skip to main content
POST
/
eth_createAccessList
curl --request POST \
  --url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_createAccessList",
  "params": [
    {
      "to": "0x0000000000000000000000000000000000000000",
      "data": "0x"
    },
    "latest"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Monad API method that creates an EIP-2930 access list for a transaction. This method returns a list of addresses and storage keys that the transaction will access, which can be used to reduce gas costs for subsequent executions.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • object — the transaction call object:
    • from (optional) — address the transaction is sent from
    • to — address the transaction is directed to
    • gas (optional) — gas provided for the call
    • gasPrice (optional) — gas price for the call
    • value (optional) — value sent with the call
    • data (optional) — hash of the method signature and encoded parameters
  • quantity|tag — the block number as a hexadecimal string, or block tag (latest, earliest, pending).

Response

  • result — an object containing:
    • accessList — array of access list entries, each with:
      • address — the address that will be accessed
      • storageKeys — array of storage keys that will be accessed
    • gasUsed — the estimated gas used with the access list

eth_createAccessList code examples

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

async function createAccessList() {
  const tx = {
    to: "0x...", // Contract address
    data: "0x..." // Encoded function call
  };

  const result = await provider.send("eth_createAccessList", [tx, "latest"]);
  console.log("Access list:", result.accessList);
  console.log(`Estimated gas: ${parseInt(result.gasUsed, 16)}`);
}

createAccessList();

Use case

A practical use case for eth_createAccessList is optimizing gas costs for complex smart contract interactions by pre-declaring the state that will be accessed, which reduces the cold access gas penalties introduced in EIP-2929.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:eth_createAccessList
params
any[]

Response

200 - application/json

The access list and estimated gas.

jsonrpc
string
id
integer
result
object