eth_createAccessList

Description is below.

This method creates an EIP2930 type accessList based on a given Transaction. The accessList contains all storage slots and addresses read and written by the transaction, except for the sender account and the precompiles. This method uses the same transaction call object and blockNumberOrTag object as eth_call. An accessList can be used to unstuck contracts that became inaccessible due to gas cost increases.

Parameters

  • Object - The transaction call object
    • from: DATA, 20 Bytes - (optional) The address the transaction is sent from.
    • to: DATA, 20 Bytes - The address the transaction is directed to.
    • gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
    • gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas
    • maxPriorityFeePerGas: Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions.
    • maxFeePerGas: Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See EIP-1559 transactions.
    • value: QUANTITY - (optional) Integer of the value sent with this transaction
    • data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation.
  • QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
curl https://ethereum-mainnet-archive.allthatnode.com/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
--request POST \
--header "Content-Type: application/json" \
--data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_createAccessList",
  "params": [
    {
      "from": "0x4B275BDea1cA622256ebb8B15B51861b52703d16",
      "to": "0xa62894D5196bC44e4C3978400Ad07E7b30352372",
      "gas": "0x13880",
      "gasPrice": "0x4B3ECF6D4",
      "data": "0xa9059cbb0000000000000000000000007422172afc6ea4da9c011e87b7cb002d55b754430000000000000000000000000000000000000000000000000c7d713b0e3f3600"
    },
    "0x10F558C"
  ]
}
'

Returns

  • address, storageKeys, and gasUsed

It gives the list of addresses and storageKeys that will be used by that transaction, plus the gas consumed if the access list is included. Like eth_estimateGas, this is an estimation; the list could change when the transaction is actually mined. Adding an accessList to a transaction does not necessary result in lower gas usage compared to a transaction without an access list.

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "accessList": [
            {
                "address": "0xa62894d5196bc44e4c3978400ad07e7b30352372",
                "storageKeys": [
                    "0xf80182ef9b7caa1f77fbfc9b0b0f8676e3961a6ca1bf217ed2e63d20a2513661",
                    "0x0000000000000000000000000000000000000000000000000000000000000007",
                    "0x000000000000000000000000000000000000000000000000000000000000001a",
                    "0x8b384e18b25cd39c6144aa7b685cdb888eb9f94a8e06d410d30bb96896b34170",
                    "0x0000000000000000000000000000000000000000000000000000000000000018",
                    "0x0000000000000000000000000000000000000000000000000000000000000009",
                    "0x06333d01f36d7b1e4eb235050a27bf5d827fe1a3a98b607e14d2c2f850e5ace8",
                    "0x542341d6e77cad88b54b8e9ba48a9bd518c76cf1e9f85dfc2ab36efa1c5a4ad8",
                    "0x0000000000000000000000000000000000000000000000000000000000000019",
                    "0x000000000000000000000000000000000000000000000000000000000000000c",
                    "0x000000000000000000000000000000000000000000000000000000000000000b",
                    "0xb79dd1c068cb632a720a31c8851e8db75e2576d16fa813b8ec37f72e3d87e25b"
                ]
            }
        ],
        "error": "out of gas",
        "gasUsed": "0xc350"
    }
}

Try yourself

Language
Click Try It! to start a request and see the response here!