For AI agents: a documentation index is available at /llms.txt. Markdown versions of pages are available by appending .md to any documentation URL.
Skip to main content

Execution methods

These methods execute calls, create access lists, estimate gas, and simulate transactions without submitting them to the network.

eth_call

Invokes a contract function locally and does not change the state of the blockchain.

You can interact with contracts using eth_sendRawTransaction or eth_call.

By default, the eth_call error response includes the revert reason.

Parameters

  • call: object - Transaction call object.

    • from: data, 20 bytes - Address of the sender.

    • to: data, 20 bytes - Address of the action receiver.

    • gas: integer - Gas provided by the sender. eth_call consumes zero gas, but other executions might need this parameter. eth_estimateGas ignores this value.

    • gasPrice: integer - Gas price, in Wei, provided by the sender. The default is 0. Used only in non-EIP1559 transactions.

    • maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only in EIP1559 transactions. If used, must specify maxFeePerGas.

    • maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only in EIP1559 transactions. If used, must specify maxPriorityFeePerGas.

    • maxFeePerBlobGas: integer - Maximum fee the sender is willing to pay per blob gas. Only used for blob transactions introduced in EIP-4844.

    • nonce: integer - Number of transactions made by the sender before this one. The default is the sender's nonce.

    • value: integer - Value transferred, in Wei.

    • data: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to input if both parameters are provided.

    • input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to data if both parameters are provided.

    • accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIER transactions.

    • strict: boolean - Determines if the sender account balance is considered during gas estimation. If true, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. If false, the balance checks are skipped. The default is true.

    • blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.


    note

    If you don't want the sender account balance checked, set the gas to zero or specify strict:false. Otherwise the call may fail if the sender account does not have sufficient funds to cover the gas fees.

  • blockNumber or blockHash: string - Hexadecimal integer representing a block number, block hash, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

    note

    pending returns the same value as latest.

  • stateOverride: object - (Optional) The address-to-state mapping. Each entry specifies a state that will be temporarily overridden before executing the call. This allows you to test, analyze, and debug smart contracts more efficiently by allowing temporary state changes without affecting the actual blockchain state.

    • balance: quantity - Temporary account balance for the call execution.

    • nonce: quantity - Temporary nonce value for the call execution.

    • code: binary - Bytecode to inject into the account.

    • movePrecompileToAddress: data, 20 bytes - Address to which the precompile address should be moved.

    • state: quantity - key:value pairs to override all slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

    • stateDiff: quantity - key:value pairs to override individual slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

Returns

  • Return value of the executed contract.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13",
"value": "0x1"
},
"latest"
],
"id": 53
}'

The following example creates a simulated contract by not including the to parameter from the transaction call object in the call parameter. Besu simulates the data to create the contract.

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"data": "0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b5061021e806100606000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd576146100ae575b600080fd5b61004e6100dc565b6040518082815260200191505060405180910390f35b61006c6100e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610107565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101b76033913960400191505060405180910390fd5b806001819055505056fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582007302f208a10686769509b529e1878bda1859883778d70dedd1844fe790c9bde64736f6c63430005100032",
"gas": "0x439cf",
"gasPrice": "0x0"
},
"latest"
],
"id": 53
}'

The following example checks the USDT contract for the balance of the address 0xfe3b557e8fb62b89f4916b721be55ceb828dbd73, with a state override that sets the balance to 20,000 USDT. The result will reflect the overridden balance for the specified address.

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"data": "0x70a08231000000000000000000000000fe3b557e8fb62b89f4916b721be55ceb828dbd73"
},
"latest",
{
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"stateDiff": {
"0xd0dd44a13782bf89714335c2b2b08ecb7c074e78a161807742c578965dda1b56": "0x0000000000000000000000000000000000000000000000000000000000004E20"
}
}
}
],
"id": 1
}'

eth_createAccessList

Creates an EIP-2930 access list that you can include in a transaction. The method returns a success response (access list and gas used) even if the simulated transaction would revert.

Parameters

  • transaction: object - Transaction call object.

    • from: data, 20 bytes - Address of the sender.

    • to: data, 20 bytes - Address of the action receiver.

    • gas: integer - Gas provided by the sender. eth_call consumes zero gas, but other executions might need this parameter. eth_estimateGas ignores this value.

    • gasPrice: integer - Gas price, in Wei, provided by the sender. The default is 0. Used only in non-EIP1559 transactions.

    • maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only in EIP1559 transactions. If used, must specify maxFeePerGas.

    • maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only in EIP1559 transactions. If used, must specify maxPriorityFeePerGas.

    • maxFeePerBlobGas: integer - Maximum fee the sender is willing to pay per blob gas. Only used for blob transactions introduced in EIP-4844.

    • nonce: integer - Number of transactions made by the sender before this one. The default is the sender's nonce.

    • value: integer - Value transferred, in Wei.

    • data: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to input if both parameters are provided.

    • input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to data if both parameters are provided.

    • accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIER transactions.

    • strict: boolean - Determines if the sender account balance is considered during gas estimation. If true, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. If false, the balance checks are skipped. The default is true.

    • blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.

  • blockNumber: string - Hexadecimal integer representing a block number, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

Returns

  • Access list object.

    • accessList: array of objects - List of objects.

      • address: string - Addresses to be accessed by the transaction.

      • storageKeys: array - Storage keys to be accessed by the transaction.

    • gasUsed: string - Approximate gas cost for the transaction if the access list is included.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"method": "eth_createAccessList",
"params": [
{
"from": "0xaeA8F8f781326bfE6A7683C2BD48Dd6AA4d3Ba63",
"data": "0x608060806080608155"
},
"pending"
],
"id": 1,
"jsonrpc": "2.0"
}'
tip

This method doesn't indicate whether a transaction would succeed or revert; to see simulation outcomes use eth_call or eth_estimateGas.


eth_estimateGas

Returns an estimate of the gas required for a transaction to complete. The estimation process does not use gas and the transaction is not added to the blockchain. The resulting estimate can be greater than the amount of gas the transaction ends up using, for reasons including EVM mechanics and node performance.

The eth_estimateGas call does not send a transaction. You must call eth_sendRawTransaction to execute the transaction.

By default, the eth_estimateGas error response includes the revert reason.

Parameters

  • call: object - Transaction call object.

    • from: data, 20 bytes - Address of the sender.

    • to: data, 20 bytes - Address of the action receiver.

    • gas: integer - Gas provided by the sender. eth_call consumes zero gas, but other executions might need this parameter. eth_estimateGas ignores this value.

    • gasPrice: integer - Gas price, in Wei, provided by the sender. The default is 0. Used only in non-EIP1559 transactions.

    • maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only in EIP1559 transactions. If used, must specify maxFeePerGas.

    • maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only in EIP1559 transactions. If used, must specify maxPriorityFeePerGas.

    • maxFeePerBlobGas: integer - Maximum fee the sender is willing to pay per blob gas. Only used for blob transactions introduced in EIP-4844.

    • nonce: integer - Number of transactions made by the sender before this one. The default is the sender's nonce.

    • value: integer - Value transferred, in Wei.

    • data: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to input if both parameters are provided.

    • input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to data if both parameters are provided.

    • accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIER transactions.

    • strict: boolean - Determines if the sender account balance is considered during gas estimation. If true, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. If false, the balance checks are skipped. The default is true.

    • blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.


    note

    If you don't want the sender account balance checked, set the gas to zero or specify strict:false. Otherwise the call may fail if the sender account does not have sufficient funds to cover the gas fees.

  • blockNumber: string - (Optional) Hexadecimal integer representing a block number, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter The default is pending.

  • stateOverride: object - The address-to-state mapping. Each entry specifies a state that will be temporarily overridden before executing the call. This allows you to make temporary state changes without affecting the actual blockchain state.

    • balance: quantity - Temporary account balance for the call execution.

    • nonce: quantity - Temporary nonce value for the call execution.

    • code: binary - Bytecode to inject into the account.

    • movePrecompileToAddress: data, 20 bytes - Address to which the precompile address should be moved.

    • state: quantity - key:value pairs to override all slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

    • stateDiff: quantity - key:value pairs to override individual slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

Returns

  • Amount of gas used.

Example

The following example returns an estimate of 21000 wei (0x5208) for the transaction.

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73",
"to": "0x44Aa93095D6749A706051658B970b941c72c1D53",
"value": "0x1"
}
],
"id": 53
}'

The following example request estimates the cost of deploying a simple storage smart contract to the network. The data field contains the hash of the compiled contract you want to deploy. (You can get the compiled contract hash from your IDE, for example, Remix > Compile tab > details > WEB3DEPLOY.) The result is 113355 wei.

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0x8bad598904ec5d93d07e204a366d084a80c7694e",
"data": "0x608060405234801561001057600080fd5b5060e38061001f6000396000f3fe6080604052600436106043576000357c0100000000000000000000000000000000000000000000000000000000900480633fa4f24514604857806355241077146070575b600080fd5b348015605357600080fd5b50605a60a7565b6040518082815260200191505060405180910390f35b348015607b57600080fd5b5060a560048036036020811015609057600080fd5b810190808035906020019092919050505060ad565b005b60005481565b806000819055505056fea165627a7a7230582020d7ad478b98b85ca751c924ef66bcebbbd8072b93031073ef35270a4c42f0080029"
}
],
"id": 1
}'

The following example estimates the gas required for the transfer call in the USDT contract, with a state override that sets the balance of the sender address to 20,000 USDT. The result provides the gas required for the transaction.

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"data": "0xa9059cbb000000000000000000000000627306090abaB3A6e1400e9345bC60c78a8BEf570000000000000000000000000000000000000000000000000000000000000064"
},
"latest",
{
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"stateDiff": {
"0xd0dd44a13782bf89714335c2b2b08ecb7c074e78a161807742c578965dda1b56": "0x0000000000000000000000000000000000000000000000000000000000004E20"
}
}
}
],
"id": 1
}'

eth_simulateV1

Simulates transactions across multiple blocks. Allows you to test transactions with custom state and block parameters without submitting them to the network.

Parameters

  • payload: object - Transaction simulation payload object.

    • blockStateCalls: array of objects - List of block state call objects.

      • blockOverrides: array of objects - List of block override objects.

        • baseFeePerGas: quantity - Base fee per gas for the block.

        • blobBaseFee: quantity - Base fee per unit of blob gas.

        • feeRecipient: data, 20 bytes - Address of the fee recipient for the block proposal.

        • gasLimit: quantity - Maximum gas allowed in this block.

        • number: quantity - Block number. When overriding block numbers across multiple blocks, block number must be increasing. By default, it's incremented by one for each block.

        • prevRandao: data, 32 bytes - Previous value of randomness.

        • time: quantity - Unix epoch time in seconds. Time must increase or remain constant relative to the previous block. By default, it's incremented by one for each block.

        • withdrawals: array - Array of withdrawals made by validators. This array can have a maximum length of 16.

      • stateOverrides: array of objects - List of state override objects.

        • balance: quantity - Temporary account balance for the call execution.

        • nonce: quantity - Temporary nonce value for the call execution.

        • code: binary - Bytecode to inject into the account.

        • movePrecompileToAddress: data, 20 bytes - Address to which the precompile address should be moved.

        • state: quantity - key:value pairs to override all slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

        • stateDiff: quantity - key:value pairs to override individual slots in the account storage. You cannot set both the state and stateDiff options simultaneously.

      • calls: array of objects - List of transaction call objects.

        • from: data, 20 bytes - Address of the sender.

        • to: data, 20 bytes - Address of the action receiver.

        • gas: quantity, integer - Gas provided by the sender. eth_call consumes zero gas, but other executions might need this parameter. eth_estimateGas ignores this value.

        • gasPrice: quantity, integer - Gas price, in Wei, provided by the sender. The default is 0. Used only in non-EIP1559 transactions.

        • maxPriorityFeePerGas: quantity, integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only in EIP1559 transactions. If used, must specify maxFeePerGas.

        • maxFeePerGas: quantity, integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only in EIP1559 transactions. If used, must specify maxPriorityFeePerGas.

        • maxFeePerBlobGas: quantity, integer - Maximum fee the sender is willing to pay per blob gas. Only used for blob transactions introduced in EIP-4844.

        • nonce: quantity, integer - Number of transactions made by the sender before this one. The default is the sender's nonce.

        • value: quantity, integer - Value transferred, in Wei.

        • data: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to input if both parameters are provided.

        • input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal to data if both parameters are provided.

        • accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIER transactions.

        • strict: tag - Determines if the sender account balance is considered during gas estimation. If true, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. If false, the balance checks are skipped. The default is true.

        • blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.

    • traceTransfers: boolean - (Optional) If true, ETH transfers are added as ERC-20 transfer events to the logs, allowing you to trace value transfers. The default is false.

    • validation: boolean - (Optional) If true, eth_simulateV1 does all the validation that a normal EVM would do, except contract sender and signature checks. If false, eth_simulateV1 behaves like eth_call. The default is false.

    • returnFullTransactionObjects: boolean - (Optional) If true, returns full transaction objects. If false, returns only hashes. The default is false.

  • blockNumber or blockHash: string - Hexadecimal integer representing a block number, block hash, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

Returns

  • List of simulation result objects.

    • All the fields of a block object.

      • number: quantity, integer - Block number. null when block is pending.

      • hash: data, 32 bytes - Hash of the block. null when block is pending.

      • parentHash: data, 32 bytes - Hash of the parent block.

      • nonce: data, 8 bytes - Hash of the generated proof of work. null when block is pending.

      • sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block.

      • logsBloom: data, 256 bytes - Bloom filter for the block logs. null when block is pending.

      • transactionsRoot: data, 32 bytes - Root of the transaction trie for the block.

      • stateRoot: data, 32 bytes - Root of the final state trie for the block.

      • receiptsRoot: data, 32 bytes - Root of the receipts trie for the block.

      • miner: data, 20 bytes - Address to pay mining rewards to.

      • difficulty: quantity, integer - Difficulty for this block.

      • totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be 0 for an uncle block.

      • extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the --miner-extra-data command line option. Stores extra data when used with IBFT.

      • size: quantity, integer - Size of block in bytes.

      • gasLimit: quantity - Maximum gas allowed in this block.

      • gasUsed: quantity - Total gas used by all transactions in this block.

      • timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly.

      • transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.

        • accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used in ACCESS_LIST transactions and may be used in EIP1559 transactions.

        • blockHash: data, 32 bytes - Hash of the block containing this transaction. null when transaction is pending.

        • blockNumber: quantity - Block number of the block containing this transaction. null when transaction is pending.

        • blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction. null when transaction is pending.

        • chainId: quantity - Chain ID.

        • from: data, 20 bytes - Address of the sender.

        • gas: quantity - Gas provided by the sender.

        • gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559 transactions.

        • maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only in EIP1559 transactions.

        • maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only in EIP1559 transactions.

        • hash: data, 32 bytes - Hash of the transaction.

        • input: data - Data sent with the transaction to create or invoke a contract.

        • nonce: quantity - Number of transactions made by the sender before this one.

        • to: data, 20 bytes - Address of the receiver. null if a contract creation transaction.

        • transactionIndex: quantity, integer - Index position of the transaction in the block. null when transaction is pending.

        • transactionType: string - Transaction type.

        • value: quantity - Value transferred, in Wei.

        • v: quantity - ECDSA Recovery ID.

        • r: data, 32 bytes - ECDSA signature r.

        • s: data, 32 bytes - ECDSA signature s.

      • uncles: array - Array of uncle hashes.

      • baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.

    • calls: array of objects - List of call result objects.

      • returnData: data - Data returned for the call.

      • logs: array - Array of log objects generated during the call.

        • removed: tag - true if log removed because of a chain reorganization. false if a valid log.

        • logIndex: quantity, integer - Log index position in the block. null when log is pending.

        • transactionIndex: quantity, integer - Index position of the starting transaction for the log. null when log is pending.

        • transactionHash: data, 32 bytes - Hash of the starting transaction for the log. null when log is pending.

        • blockHash: data, 32 bytes - Hash of the block that includes the log. null when log is pending.

        • blockNumber: quantity - Number of block that includes the log. null when log is pending.

        • blockTimestamp: quantity - Hex-encoded unix timestamp (in seconds) of the block that includes the log.

        • address: data, 20 bytes - Address the log originated from.

        • data: data - Non-indexed arguments of the log.

        • topics: array of data, 32 bytes each - Event signature hash and 0 to 3 indexed log arguments.

      • gasUsed: quantity - Amount of gas used by the call.

      • maxUsedGas: quantity - Maximum gas used during the call before any refunds.

      • status: quantity - Status indicating whether the call succeeded (0x1). 0x0 indicates that a call has failed.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_simulateV1",
"params": [
{
"blockStateCalls": [
{
"blockOverrides": {
"baseFeePerGas": "0x9"
},
"stateOverrides": {
"0xc000000000000000000000000000000000000000": {
"balance": "0x4a817c800"
}
},
"calls": [
{
"from": "0xc000000000000000000000000000000000000000",
"to": "0xc000000000000000000000000000000000000001",
"maxFeePerGas": "0xf",
"value": "0x1"
},
{
"from": "0xc000000000000000000000000000000000000000",
"to": "0xc000000000000000000000000000000000000002",
"maxFeePerGas": "0xf",
"value": "0x1"
}
]
}
],
"validation": true,
"traceTransfers": true
},
"latest"
],
"id": 1
}'