Simulate JSON RPC
The custom RPC methods appear in the
tenderly_
namespace.tenderly_simulateTransaction
Simulates transaction as it would execute on the given block.
Params
- Transaction Transaction
OBJECT
- from (optional)
STRING
: hex encoded address - to
STRING
: hex encoded address - gas (optional)
NUMBER
- maxFeePerGas (optional)
NUMBER
max fee: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - maxPriorityFeePerGas (optional)
NUMBER
max priority fee: Maximum fee per gas the sender is willing to pay to miners in wei - gasPrice (optional)
NUMBER
: The gas price willing to be paid by the sender in wei - value (optional)
NUMBER
- data (optional)
STRING
: hex encoded bytes - accessList (optional)
ARRAY
of Access list entryOBJECT
- address
STRING
hex encoded address - storageKeys
ARRAY
ofSTRING
representation of 32 byte hex encoded storage key
- address
- from (optional)
- Simulation Block Number (optional) The block number against which transaction should be simulated. Either:
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
- State Overrides (optional)
MAP
: mapping from an account (address) to override specification- key
STRING
: the account this override applies to - value
OBJECT
: the override specification- nonce (optional)
STRING
: hex encoded 8 byte nonce override for the account - code (optional)
STRING
: data of the code override for the account - balance (optional)
STRING
: hex encoded 32 byte balance override for the account in wei - stateDiff (optional)
MAP
: mapping of storage key to storage value override- key
STRING
: the storage key - value
STRING
: the value override for the given storage key
- key
- nonce (optional)
- key
- Block Overrides (optional)
OBJECT
: The set of header fields to override in a block.- number (optional)
STRING
: hex, overrides the block number - difficulty (optional)
STRING
: hex, overrides the block difficulty - time (optional)
STRING
: hex, overrides block timestamp - gasLimit (optional)
STRING
: hex, overrides gas limit - coinbase (optional)
STRING
: hex, overrides block miner - random (optional)
STRING
: hex, overrides the blocks extra data which feeds into the RANDOM opcode - baseFee (optional)
STRING
: hex, overrides block base fee
- number (optional)
Example
example.json
{
"id": 0,
"jsonrpc": "2.0",
"method": "tenderly_simulateTransaction",
"params": [
{
"from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"data": "0xa9059cbb00000000000000000000000020a5814b73ef3537c6e099a0d45c798f4bd6e1d60000000000000000000000000000000000000000000000000000000000000001"
},
"0xF4D880"
]
}
Result
Simulation result OBJECT
- status
NUMBER:
either1
(success) or0
(failure) - gasUsed
NUMBER
: The amount of gas used by this specific transaction alone - cumulativeGasUsed
NUMBER
: the total amount of gas used when this transaction was executed in the block - blockNumber
NUMBER
: the block number in which this transaction was simulated - type
NUMBER
: transaction type,0x00
for legacy transactions,0x01
for access list types,0x02
for dynamic fees - logsBloom
STRING
: bloom filter for light clients to quickly retrieve related logs - logs: an array of emitted events
ARRAY
ofOBJECT
- name
STRING
: event name - anonymous
BOOLEAN
: indicates if event is anonymous - inputs: array of decoded log arguments
ARRAY
of decoded logsOBJECT
- name
STRING
: event argument name - type
STRING
: event argument type from Solidity type system - value (optional)
STRING
string representation value of the argument; interpret according to thetype
field
- name
- raw
OBJECT
: raw logs- address
STRING
hex encoded address: address of the contract emitting the log - topics
ARRAY
ofSTRING
32 hex encoded bytes - data
STRING
hex encoded string representing event data
- address
- name
- trace: Trace
ARRAY
ofOBJECT
- type
STRING
type: trace item type - eitherCALL
|CALLCODE
|STATICCALL
|DELEGATECALL
|CREATE
|CREATE2
|SELFDESTRUCT
- from
STRING
: hex encoded address - to
STRING
: hex encoded address - gas
STRING
: hex encoded unsigned 64 byte integer representing event gas - gasUsed
STRING
: hex encoded unsigned 64 byte integer representing event gasUsed - value
STRING
: hex encoded unsigned 64 byte integer representing event value in wei - error
STRING
: low-level error from virtual machine - errorReason
STRING
: extracted error reason in case of revert - input
STRING
: hex encoded string representation of raw input bytes for the trace point - method
STRING
: invoked contract method - decodedInput : decoded input for the invoked method -
ARRAY
of decoded in argumentOBJECT
- value
STRING
: string representation value of the argument; interpret according to thetype
field. - type
STRING
: the Solidity type of this argument - name
STRING
: the name of this argument
- value
- output
STRING
: raw trace output - decodedOutput : decoded output of the invoked method -
ARRAY
of decoded out argumentOBJECT
- value
STRING
: string representation value of the argument; interpret according to thetype
field. - type
STRING
: the Solidity type of this argument - name
STRING
: the name of this argument
- value
- subtraces
NUMBER
: number of child traces - traceAddress : trace position
ARRAY
ofNUMBER
- type
assetChanges
ARRAY
:type
STRING
type of asset change, can be transfer, mint, burnfrom
STRING
: address of the sender (empty for mint transfers)to
STRING
: address of the receiver (empty for burn transfers)amount
STRING
: the amount of the token that was transferredrawAmount
STRING
: raw amount transfer for the tokendollarValue
STRING
: dollar value of the transferred tokenassetInfo
OBJECT
: asset informationstandard
STRING
: supported token standards: ERC20, ERC721, NativeCurrencytype
STRING
: the token type: Native, Fungible, Non-FungiblecontractAddress
STRING
: address of the contractsymbol
STRING
: token symbolname
STRING
: token namelogo
STRING
: URL for the token icondecimals
NUMBER
: number of decimals in the tokendollarValue
STRING
: dollar value of a single token
balanceChanges
ARRAY
: an array of balance changes - cumulated asset changesaddress
STRING
addressdollarValue
STRING
: dollar value of cumulated asset changestransfers
ARRAY
: array of asset changes indexes