eth_createAccessList
Creates an EIP-2930 access list that you can include in a transaction.
Use this method to optimize your smart contract interactions. Access lists are a part of Ethereum's EIP-2930, which aims to improve the network's scalability and reduce gas costs by specifying an explicit list of addresses and storage keys that a transaction intends to access.
Optimizing Ethereum Transactions
See the Infura article Optimizing Ethereum Transactions with eth_createAccessList that describes how eth_createAccessList
can help optimize gas costs, reduce out-of-gas errors, and verify clients for infrastructure access.
Parameters
Transaction call object
: [Required]from
: [optional] 20 bytes. The address of the sender.to
: 20 bytes. Address the transaction is directed to.gas
: [optional] Hexadecimal value of the gas provided for the transaction execution.gasPrice
: [optional] Hexadecimal value gas price, in Wei, provided by the sender. The default is0
. Used only in non-EIP-1559 transactions.maxPriorityFeePerGas
: [optional] Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions. If used, must specifymaxFeePerGas
.maxFeePerGas
: [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See EIP-1559 transactions. If used, must specifymaxPriorityFeePerGas
.value
: [optional] Hexadecimal of the value transferred, in Wei.data
: [optional] Hash of the method signature and encoded parameters. See Ethereum contract ABI specification.
block number
orblock hash
: [required] A string representing a block number, block hash, or one of the string tagslatest
,earliest
,pending
,safe
, orfinalized
. See the default block parameter.
Returns
Access list object with the following fields:
accessList
: A list of objects with the following fields:address
: Addresses to be accessed by the transaction.storageKeys
: Storage keys to be accessed by the transaction.
gasUsed
: A hexadecimal string representing the approximate gas cost for the transaction if the access list is included.
Example
Replace YOUR-API-KEY
with an API key from your Infura dashboard.