tenderly_simulateTransaction - Ethereum Mainnet
Summary
Simulates a transaction as it would execute on the given block, allowing overrides of state variables and balances of all accounts.
The method returns:
- decoded
logs
, - decoded call
trace
, - decoded asset changes (
assetChanges
), - decoded state changes (
stateChanges
), - balance changes (
balanceChanges
), - nonce change,
- code change (when simulating a code override).
Note: change fields (
assets
, balance
, state
and nonce
, and code
) are omitted if no change has taken place.Parameters
1. Transaction Call
From Address
The address the transaction is sent from
Example:
0x12345...
To Address
The address the transaction is directed to
Example:
0x12345...
Gas Hex
Integer of the gas provided for the transaction execution
Example:
0x3fa89
Gas Price Hex
Integer of the
gasPrice
used for each paid gasExample:
0xff
Value Hex
Integer of the value sent with this transaction
Example:
0xff
Input Bytes
Hash of the method signature and encoded parameters
Example:
0x00000...
MaxFeePerGas Number
Specifies the maximum fee per unit of gas the sender is willing to pay for the transaction.
Example:
0x2540be400
MaxPriorityFeePerGas Number
Indicates the maximum priority fee per unit of gas to incentivize miners for transaction processing.
Example:
0x3b9aca00
AccessList Number
Defines addresses and storage keys that the transaction intends to access for optimized gas usage.
Example:
[{'address': '0x1234...', 'storageKeys': ['0x5678...', '0x9abc...']}]
MaxFeePerBlobGas Number
Specifies the maximum fee per unit of gas for processing data blobs within the transaction.
Example:
0x12a05f200
BlobVersionedHashes Number
Contains versioned hashes for data blobs associated with the transaction to ensure integrity.
Example:
['0x123456789abcdef...', '0xfedcba987654321...']
2. Block Number Quantity or Tag
Hex block number, or the tag
latest
, earliest
, pending
, finalized
or safe
Example:
latest
3. State Overrides
Key Address
The account to override balance or storage
Example:
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Nonce Number
Hex encoded 8 byte nonce override for the account
Example:
0x1e91
Code DATA
Data of the code override for the account
Example:
N/A
Balance Number
hex encoded balance override for the account in wei
Example:
0x8062461898512542557
State Diff JSON
Mapping from storage slot to override value for that slot
Example:
{"0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03": "0x0000000000000000000000000000000000000000000000000000000000000001"}
4. Block Overrides
Number Number
Overrides the block number
Example:
0x129d59a
Difficulty Number
Overrides the block difficulty
Example:
0xff
Time Number
Overrides the block timestamp
Example:
0x18e7ac25d30
Gas Limit Number
Overrides gas limit
Example:
0x1c9c380
Coinbase Number
Overrides block miner
Example:
0xff
Random Number
overrides the blocks extra data which feeds into the RANDOM opcode
Example:
0xff
Base Fee Number
Overrides block base fee
Example:
0x6d974775d
Code Examples
tenderly_simulateTransaction request
curl https://mainnet.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \ -X POST \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 0, "method": "tenderly_simulateTransaction", "params": [ { "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "input": "0x40c10f19000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce10000000000000000000000000000000000000000000000001bc16d674ec80000", "maxFeePerGas": "0x6d974775d", "maxPriorityFeePerGas": "0x3b9aca00", "accessList": [ { "address": "0x1234567890abcdef1234567890abcdef12345678", "storageKeys": [ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" ] } ], "maxFeePerBlobGas": "0x12a05f200" }, "latest", { "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2": { "balance": "0x3635c9adc5dea00000" }, "0x6b175474e89094c44da98b954eedeac495271d0f": { "stateDiff": { "0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03": "0x0000000000000000000000000000000000000000000000000000000000000001" }, "balance": "0x8062461898512542557", "nonce": "0x1e91" } }, { "number": "0x129d59a", "time": "0x18e7ac25d30", "gasLimit": "0x1c9c380", "baseFee": "0x6d974775d" } ] }'
tenderly_simulateTransaction response
{ "id": 0, "jsonrpc": "2.0", "result": { "status": true, "gasUsed": "0xe1a5", "cumulativeGasUsed": "0xe1a5", "blockNumber": "0x129d59a", "type": "0x2", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000010000000020000000000000000000800000000000000000000000010000000000000000000004000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000020000000002000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", "logs": [ { "name": "Transfer", "anonymous": false, "inputs": [ { "value": "0x0000000000000000000000000000000000000000", "type": "address", "name": "src", "indexed": true }, { "value": "0xe58b9ee93700a616b50509c8292977fa7a0f8ce1", "type": "address", "name": "dst", "indexed": true }, { "value": "2000000000000000000", "type": "uint256", "name": "wad", "indexed": false } ], "raw": { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce1" ], "data": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000" } } ], "trace": [ { "type": "CALL", "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "gas": "0x23c2e0c0", "gasUsed": "0x7c65", "value": "0x0", "input": "0x40c10f19000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce10000000000000000000000000000000000000000000000001bc16d674ec80000", "decodedInput": [ { "value": "0xe58b9ee93700a616b50509c8292977fa7a0f8ce1", "type": "address", "name": "usr", "indexed": false }, { "value": "2000000000000000000", "type": "uint256", "name": "wad", "indexed": false } ], "method": "mint", "output": "0x", "subtraces": 0, "traceAddress": [] } ], "assetChanges": [ { "assetInfo": { "standard": "ERC20", "type": "Fungible", "contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f", "symbol": "dai", "name": "Dai", "logo": "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996", "decimals": 18, "dollarValue": "1" }, "type": "Mint", "to": "0xe58b9ee93700a616b50509c8292977fa7a0f8ce1", "rawAmount": "0x1bc16d674ec80000", "amount": "2", "dollarValue": "2" } ], "balanceChanges": [ { "address": "0xe58b9ee93700a616b50509c8292977fa7a0f8ce1", "dollarValue": "2", "transfers": [ 0 ] } ], "stateChanges": [ { "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "storage": [ { "slot": "0x0000000000000000000000000000000000000000000000000000000000000001", "previousValue": "0x00000000000000000000000000000000000000000a633fa9d3eb778f953ef8bb", "newValue": "0x00000000000000000000000000000000000000000a633fa9eface4f6e406f8bb" }, { "slot": "0x9b5472766fd311751f6a33c8e30061e20a26259ca626cf5a2feaadf96903cd9e", "previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000", "newValue": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000" } ] }, { "address": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2", "nonce": { "previousValue": "0x0", "newValue": "0x1" }, "balance": { "previousValue": "0x3635c9adc5dea00000", "newValue": "0x3635c3a43c59a6540f" } } ] } }