POSTeth_simulateV1
https://polygon-mainnet.nodit.io/Simulates the execution of multiple transactions across one or more blocks without broadcasting them to the network. Similar to eth_call, but lets you run a sequence of calls with the block context (block number, timestamp, base fee, and so on) and account state overridden with arbitrary values. Use it to debug smart contract interactions, estimate gas usage, or validate bundled transactions.
Enter the following parameters as an array according to their types.
simulation payload- The block and call definitions to simulate (blockStateCalls) and the simulation options (traceTransfers,validation,returnFullTransactions).block identifier- The parent block used as the base of the simulation. You can enter a block number, block hash, or block tag. Defaults tolatestwhen omitted.
Array of block definitions to simulate. Up to 256 blocks can be specified, and each block is executed sequentially.
Overrides the block context used for the simulation.
The block number to simulate, as a hex string. Block numbers must increase; skipped block numbers are included in the response as empty blocks.
The block timestamp as a hex string.
The block gas limit as a hex string.
The address that receives the fees, as a string.
The PREVRANDAO value of the block, as a hex string.
The base fee per gas of the block, as a hex string.
The blob base fee of the block, as a hex string.
List of validator withdrawals to include in the block. (EIP-4895)
Overrides account state with arbitrary values for the duration of the simulation only, without changing on-chain state. Each key is a target address, and its value can contain the following fields.
balance: A hex string that overrides the account balance.nonce: A hex string that overrides the account nonce.code: Fake EVM bytecode to inject into the account, as a hex string.state: A set of key-value pairs that replaces the entire account storage. Each key and value is a hex string.stateDiff: A set of key-value pairs that overrides individual account storage slots. Similar tostate, but used when only specific slots should be changed.movePrecompileToAddress: Moves the precompile at this address to another address. It is applied before thecodeoverride, and the behavior is client-specific when the target is not a precompile.
state and stateDiff are mutually exclusive — specify only one of them per account.
Array of call objects to execute sequentially in this block.
The transaction type as a hex string. Defaults to 0x2 (EIP-1559).
The transaction sender (from) address as a string.
The transaction recipient (to) address as a string. Can be omitted when deploying a contract.
The gas limit allocated to this call, as a hex string.
The price per gas unit, as a hex string. (Legacy transactions)
The maximum fee per gas you are willing to pay, as a hex string. (EIP-1559)
The maximum priority fee per gas paid to the validator, as a hex string. (EIP-1559)
The maximum fee per blob gas you are willing to pay, as a hex string. Defaults to 0x0. (EIP-4844)
Versioned hashes of the blobs. Defaults to an empty array. (EIP-4844)
The transaction nonce as a hex string.
The value of the transaction.
The hashed method signature of the transaction to execute. You can find it in the ABI. It can also be provided in the data field.
List of addresses and storage keys the transaction accesses during execution. (EIP-2930)
When set to true, native token transfers are included in the response logs as ERC-20 Transfer events. Defaults to false.
When set to true, EVM validation rules (balance, nonce, fees, and so on) are applied except for signature checks, making the simulation closer to a real transaction. Defaults to false.
When set to true, the transactions field in the response returns full transaction objects instead of transaction hashes. Defaults to false.
Use one of block hash, block number, or block tag to specify a block.
- Block number: hex string (ex. "0x1")
- Block hash: 64-character hex string (ex. "0x39008d07edf93c03bb9d1cfc80598fcf63f441ec86e9de3733fa6a484980ca48")]
- Block tag: enum string (ex. "latest", "earliest", "pending")
earliest: The oldest available block on the chain.finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.safe: A recent block considered safe by the network (immune to reorgs).latest: The most recent block on the chain (may be subject to reorgs).pending: The next block to be mined, including pending transactions in the mempool.
Base fee per gas of the simulated block (EIP-1559, hex wei)
Amount of blob gas used in the block (EIP-4844, hex)
Block difficulty (hex)
Amount of blob gas used above the target (EIP-4844, hex)
Arbitrary data included in the block (hex)
Maximum total gas allowed in this block (hex)
Total gas used by all transactions in this block (hex)
Hash of the simulated block
Bloom filter for event log search (2048 bits, hex)
Block miner address. Can be changed with blockOverrides.feeRecipient.
Mix hash of the block
Block nonce (hex)
Simulated block number (hex)
Root hash of the parent beacon block (EIP-4788)
Hash of the parent block
Root hash of the transaction receipts trie
SHA3 hash of the uncles list
Block size in bytes (hex)
Root hash of the state trie
Block creation time (Unix timestamp, hex). Can be changed with blockOverrides.time.
List of transactions included in the block. Returns an array of full transaction objects when returnFullTransactions is set to true, and an array of transaction hashes otherwise.
Root hash of the transactions trie
Array of uncle block hashes
Withdrawal index (hex)
Validator index (hex)
Withdrawal recipient address
Withdrawal amount (in Gwei, hex)
Root hash of the withdrawals trie (EIP-4895)
Execution status of the call. Returns 0x1 on success and 0x0 on failure (including reverts).
Data returned by the call (hex). Contains the revert data when the call fails.
Amount of gas used to execute the call (hex)
Maximum gas used during execution before refunds are applied (hex)
Event logs emitted during the call. When traceTransfers is set to true, native token transfers are also included as ERC-20 Transfer events (address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee).
The address of the contract that emitted this log
Array of event signature hash and indexed parameters (up to 4 entries)
Non-indexed event parameter data (hex encoded)
Block number containing this log (hex)
Hash of the transaction that created this log
Transaction position index within the block (hex)
Hash of the block containing this log
Log position index within the block (hex)
True if the log was removed due to a chain reorganization
Error object returned only when the call fails.
Error code. Returns 3 when the call reverted, or -32015 on a VM execution error.
Error message
Additional error data such as the revert reason (hex). May not be provided depending on the client.