L0vdL0vd

eth_createAccessList

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

Архив · Работает на любом прошлом блоке

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"]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "accessList": [
      {
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "storageKeys": [
          "0x000000000000000000000000000000000000000000000000000000000000000a",
          "0x0000000000000000000000000000000000000000000000000000000000000001"
        ]
      }
    ],
    "gasUsed": "0x6ce3"
  }
}
Параметры и свой эндпоинт

Параметры

transactionobjectобязательный
Transaction object.
blockstringобязательный
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.

Возвращает

object Access list and gas estimate.

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

Когда использовать

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

Как читать ответ

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

Советы

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

Связанные методы