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_callconsumes zero gas, but other executions might need this parameter.eth_estimateGasignores this value. -
gasPrice: integer - Gas price, in Wei, provided by the sender. The default is0. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only inEIP1559transactions. If used, must specifymaxFeePerGas. -
maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only inEIP1559transactions. If used, must specifymaxPriorityFeePerGas. -
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 toinputif both parameters are provided. -
input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal todataif both parameters are provided. -
accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIERtransactions. -
strict: boolean - Determines if the sender account balance is considered during gas estimation. Iftrue, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. Iffalse, the balance checks are skipped. The default istrue. -
blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.
noteIf 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. -
-
blockNumberorblockHash: string - Hexadecimal integer representing a block number, block hash, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest. -
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:valuepairs to override all slots in the account storage. You cannot set both thestateandstateDiffoptions simultaneously. -
stateDiff: quantity -key:valuepairs to override individual slots in the account storage. You cannot set both thestateandstateDiffoptions simultaneously.
-
Returns
- Return value of the executed contract.
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
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
}'
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13",
"value": "0x1"
},
"latest"
],
"id": 53
}
{
"jsonrpc": "2.0",
"id": 53,
"result": "0x"
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13\", data :\"0x12a7b914\"}){data status}}}"
}'
{
block {
number
call(data: {from: "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", to: "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13", data: "0x12a7b914"}) {
data
status
}
}
}
{
"data": {
"block": {
"number": 17449,
"call": {
"data": "0x",
"status": 1
}
}
}
}
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 HTTP
- JSON result
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
}'
{
"jsonrpc": "2.0",
"id": 53,
"result": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd576146100ae575b600080fd5b61004e6100dc565b6040518082815260200191505060405180910390f35b61006c6100e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610107565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101b76033913960400191505060405180910390fd5b806001819055505056fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582007302f208a10686769509b529e1878bda1859883778d70dedd1844fe790c9bde64736f6c63430005100032"
}
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 HTTP
- JSON result
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
}'
{
"jsonrpc":"2.0",
"id":1,
"result":"0x0000000000000000000000000000000000000000000000000000000000004e20"
}
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_callconsumes zero gas, but other executions might need this parameter.eth_estimateGasignores this value. -
gasPrice: integer - Gas price, in Wei, provided by the sender. The default is0. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only inEIP1559transactions. If used, must specifymaxFeePerGas. -
maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only inEIP1559transactions. If used, must specifymaxPriorityFeePerGas. -
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 toinputif both parameters are provided. -
input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal todataif both parameters are provided. -
accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIERtransactions. -
strict: boolean - Determines if the sender account balance is considered during gas estimation. Iftrue, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. Iffalse, the balance checks are skipped. The default istrue. -
blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.
-
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, 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 HTTP
- wscat WS
- JSON result
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"
}'
{
"method": "eth_createAccessList",
"params": [
{
"from": "0xaeA8F8f781326bfE6A7683C2BD48Dd6AA4d3Ba63",
"data": "0x608060806080608155"
},
"pending"
],
"id": 1,
"jsonrpc": "2.0"
}
{
"accessList": [
{
"address": "0xa02457e5dfd32bda5fc7e1f1b008aa5979568150",
"storageKeys": [
"0x0000000000000000000000000000000000000000000000000000000000000081",
]
}
]
"gasUsed": "0x125f8"
}
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_callconsumes zero gas, but other executions might need this parameter.eth_estimateGasignores this value. -
gasPrice: integer - Gas price, in Wei, provided by the sender. The default is0. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only inEIP1559transactions. If used, must specifymaxFeePerGas. -
maxFeePerGas: integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only inEIP1559transactions. If used, must specifymaxPriorityFeePerGas. -
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 toinputif both parameters are provided. -
input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal todataif both parameters are provided. -
accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIERtransactions. -
strict: boolean - Determines if the sender account balance is considered during gas estimation. Iftrue, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. Iffalse, the balance checks are skipped. The default istrue. -
blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.
noteIf 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 tagslatest,earliest,pending,finalized, orsafe, as described in block parameter The default ispending. -
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:valuepairs to override all slots in the account storage. You cannot set both thestateandstateDiffoptions simultaneously. -
stateDiff: quantity -key:valuepairs to override individual slots in the account storage. You cannot set both thestateandstateDiffoptions simultaneously.
-
Returns
- Amount of gas used.
Example
The following example returns an estimate of 21000 wei (0x5208) for the transaction.
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
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
}'
{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73",
"to": "0x44Aa93095D6749A706051658B970b941c72c1D53",
"value": "0x1"
}
],
"id": 53
}
{
"jsonrpc": "2.0",
"id": 53,
"result": "0x5208"
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block{estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", to :\"0x8888f1f195afa192cfee860698584c030f4c9db1\"})}}"
}'
{
block {
estimateGas(data: {from: "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", to: "0x8888f1f195afa192cfee860698584c030f4c9db1"})
}
}
{
"data": {
"block": {
"estimateGas": 21000
}
}
}
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 HTTP request
- JSON result
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
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1bacb"
}
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 HTTP request
- JSON result
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
}'
{
"jsonrpc":"2.0",
"id":1,
"result":"0xfa07"
}
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:valuepairs to override all slots in the account storage. You cannot set both thestateandstateDiffoptions simultaneously. -
stateDiff: quantity -key:valuepairs to override individual slots in the account storage. You cannot set both thestateandstateDiffoptions 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_callconsumes zero gas, but other executions might need this parameter.eth_estimateGasignores this value. -
gasPrice: quantity, integer - Gas price, in Wei, provided by the sender. The default is0. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Can be used only inEIP1559transactions. If used, must specifymaxFeePerGas. -
maxFeePerGas: quantity, integer - Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Can be used only inEIP1559transactions. If used, must specifymaxPriorityFeePerGas. -
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 toinputif both parameters are provided. -
input: data - Hash of the method signature and encoded parameters. For details, see Ethereum Contract ABI. Must be equal todataif both parameters are provided. -
accessList: array - List of addresses and storage keys that the transaction plans to access. Used only in non-FRONTIERtransactions. -
strict: tag - Determines if the sender account balance is considered during gas estimation. Iftrue, the sender's balance is checked against the transaction's gas parameters. This ensures the estimated gas reflects what the sender can actually afford. Iffalse, the balance checks are skipped. The default istrue. -
blobVersionedHashes: array - List of references to blobs introduced in EIP-4844.
-
-
-
traceTransfers: boolean - (Optional) Iftrue, ETH transfers are added as ERC-20 transfer events to the logs, allowing you to trace value transfers. The default isfalse. -
validation: boolean - (Optional) Iftrue,eth_simulateV1does all the validation that a normal EVM would do, except contract sender and signature checks. Iffalse,eth_simulateV1behaves likeeth_call. The default isfalse. -
returnFullTransactionObjects: boolean - (Optional) Iftrue, returns full transaction objects. Iffalse, returns only hashes. The default isfalse.
-
-
blockNumberorblockHash: string - Hexadecimal integer representing a block number, block hash, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.
Returns
-
List of simulation result objects.
-
All the fields of a block object.
-
number: quantity, integer - Block number.nullwhen block is pending. -
hash: data, 32 bytes - Hash of the block.nullwhen block is pending. -
parentHash: data, 32 bytes - Hash of the parent block. -
nonce: data, 8 bytes - Hash of the generated proof of work.nullwhen 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.nullwhen 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 be0for 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-datacommand 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 inACCESS_LISTtransactions and may be used inEIP1559transactions. -
blockHash: data, 32 bytes - Hash of the block containing this transaction.nullwhen transaction is pending. -
blockNumber: quantity - Block number of the block containing this transaction.nullwhen transaction is pending. -
blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction.nullwhen 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-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only inEIP1559transactions. -
maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only inEIP1559transactions. -
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.nullif a contract creation transaction. -
transactionIndex: quantity, integer - Index position of the transaction in the block.nullwhen 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 -trueif log removed because of a chain reorganization.falseif a valid log. -
logIndex: quantity, integer - Log index position in the block.nullwhen log is pending. -
transactionIndex: quantity, integer - Index position of the starting transaction for the log.nullwhen log is pending. -
transactionHash: data, 32 bytes - Hash of the starting transaction for the log.nullwhen log is pending. -
blockHash: data, 32 bytes - Hash of the block that includes the log.nullwhen log is pending. -
blockNumber: quantity - Number of block that includes the log.nullwhen 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).0x0indicates that a call has failed.
-
-
Example
- curl HTTP request
- wscat WS request
- JSON result
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
}'
{
"jsonrpc": "2.0",
"method": "eth_simultateV1",
"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
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"baseFeePerGas": "0x9",
"blobGasUsed": "0x0",
"calls": [
{
"gasUsed": "0x5208",
"maxUsedGas": "0x7530",
"logs": [
{
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"blockHash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"blockNumber": "0x1496e50",
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000c000000000000000000000000000000000000000",
"0x000000000000000000000000c000000000000000000000000000000000000001"
],
"transactionHash": "0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51",
"transactionIndex": "0x0"
}
],
"returnData": "0x",
"status": "0x1"
},
{
"gasUsed": "0x5208",
"maxUsedGas": "0x7530",
"logs": [
{
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"blockHash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"blockNumber": "0x1496e50",
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"logIndex": "0x1",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000c000000000000000000000000000000000000000",
"0x000000000000000000000000c000000000000000000000000000000000000002"
],
"transactionHash": "0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa",
"transactionIndex": "0x1"
}
],
"returnData": "0x",
"status": "0x1"
}
],
"difficulty": "0x0",
"excessBlobGas": "0x4920000",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"hash": "0xc98388385b0dbfc15ad5c6a0f4b19f7abd94efb4618ced05e3eb320ee30b1e7f",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x7e2a2fa2a064f693f0a55c5639476d913ff12d05",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x1496e50",
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xddd47e7383c8ced495e85e053f898d7a333feb0432fa9098306f6f563cde4984",
"receiptsRoot": "0x75308898d571eafb5cd8cde8278bf5b3d13c5f6ec074926de3bb895b519264e1",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x29c",
"stateRoot": "0xd6da11fae4ab94ddba2c4c71206962f7c6eaec6e5fabf00f3f7540c4ed7ad8f1",
"timestamp": "0x67803e64",
"transactions": [
"0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51",
"0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa"
],
"transactionsRoot": "0x9bdb74f3ce41f5893a02a631e904ae0d21ae8c4e416786d8dbd9cb5c54f1dc0f",
"uncles": [],
"withdrawals": [],
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
]
}