L0vdL0vd

eth_createAccessList

Builds an EIP-2930 access list for a transaction and reports the gas it would use with it.

Archive · Works on any past block

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_createAccessList","params":[{"from":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","to":"0xdAC17F958D2ee523a2206206994597C13D831ec7","data":"0x18160ddd"},"0x1208a5f"]}'

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "accessList": [
      {
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "storageKeys": [
          "0x000000000000000000000000000000000000000000000000000000000000000a",
          "0x0000000000000000000000000000000000000000000000000000000000000001"
        ]
      }
    ],
    "gasUsed": "0x6ce3"
  }
}
Params and your endpoint

Parameters

transactionobjectrequired
Transaction object.
blockstringrequired
Block number in hex (e.g. "0x1208a5f") or a tag: "latest", "safe", "finalized", "earliest" or "pending". L0vd endpoints run archive nodes, so any historical block works.

Returns

object Access list and gas estimate.

accessListarray
Addresses and storage keys the transaction touches.
gasUsedstring
Gas used with the access list, hex.

When to use it

Get the EIP-2930 access list (addresses and storage keys) a transaction touches, plus the gas it uses with that list.

How to read the result

accessList lists address and storageKeys; gasUsed is the estimate with the list applied.

Tips

  • Attaching the list to a type 1 or type 2 transaction can save gas for contracts that read many cold slots.

Related methods