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": {}
}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": {}
}object — the transaction call object:
from (optional) — address the transaction is sent fromto — address the transaction is directed togas (optional) — gas provided for the callgasPrice (optional) — gas price for the callvalue (optional) — value sent with the calldata (optional) — hash of the method signature and encoded parametersquantity|tag — the block number as a hexadecimal string, or block tag (latest, earliest, pending).result — an object containing:
accessList — array of access list entries, each with:
address — the address that will be accessedstorageKeys — array of storage keys that will be accessedgasUsed — the estimated gas used with the access listeth_createAccessList code examplesconst { 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();
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.Was this page helpful?