Simulate transaction
Call the simulate endpoint to preview the outcomes a single transaction before sending it to the live network. You can simulate transactions with custom parameters on 105+ supported networks. The output provides detailed insights into emitted events, state changes, asset and balance changes, among other things.
Learn about single transaction simulations.
The response returns the following objects:
transaction: Contains data related to the transaction, including its hash, block number, origin and destination addresses, gas details, input data, nonce, and other transaction details, like the status, timestamp, and involved contract addresses.
simulation: Contains data about the simulated transaction. It provides details related to the ID of the simulation, project and owner IDs, block number where the transaction was included, gas used, method invoked, simulation status, and other metadata.
contracts: Contains data about the contract(s) involved in the transaction, including the contract’s ID, network ID, balance, verification status, associated standards (like ERC20), token-specific data if the contract is a token, compiler version, and even the source code of the contract in some cases.
generated_access_list: Contains a list of addresses and storage keys that the transaction will access, enabling certain gas cost optimizations. The access list is a feature introduced in Ethereum’s EIP-2930.
Authorizations
An API key is a token that a client provides when making API calls. The key can be sent as a request header:
curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Account slug of the user
Project slug of the account
Body
Simulate transaction payload
ID of the network on which the simulation is being run.
"1"
Address initiating the transaction.
"0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df"
The recipient address of the transaction.
"0xdef171fe48cf0115b1d80b88dc8eab59176fee57"
Encoded contract method call data.
"0xa94e78ef000000000000000000000000000000000000000000000000000000000000002000000000000000000000000068037790a0229e9ce6eaa8a99ea92964106c470300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000145dc1b2e00000000000000000000000000000000000000000000000000000001477f4d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000064d281e65c9438a5a99c4bccb1035296d5d2d8d200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000320000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a73000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002b68037790a0229e9ce6eaa8a99ea92964106c47030001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a730000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000060000000000000000000000001b81d678ffb9c0263b24a97847620c99d213eb14000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
Amount of gas provided for the simulation.
648318
Number of the block to be used for the simulation.
17884583
Index of the transaction within the block.
0
String representation of a number that represents price of the gas in Wei.
"18312000018"
Maximum fee per gas for EIP-1559 transactions. String representation of a number in Wei.
"20000000000"
Maximum priority fee (tip) per gas for EIP-1559 transactions. String representation of a number in Wei.
"1000000000"
Transaction nonce override. If not specified, the nonce is automatically determined from the sender's current state.
0
Flag that enables precise gas estimation.
false
Amount of Ether (in Wei) sent along with the transaction.
"0"
Flag that enables returning the access list in a response.
false
List of addresses with their storage keys to grant access for this transaction.
[
{
"address": "0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df",
"storage_keys": []
}
]
Flag indicating whether to save the simulation in dashboard UI.
true
Flag indicating whether to save failed simulation in dashboard UI.
true
Opt for quick, abi, or full simulation API mode.
full, quick, abi "full"
Overrides for specific block header.
{
"number": "0x110ace7",
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0xef53217576746e2df5a5acb6993b629e548592008c22e5eb0c543ab0e597102f",
"parentHash": "0x0cf8a2db87cf124e1c8fceffd12c325e07fb51736c7dce9d0f945913616cb40a",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"transactionsRoot": "0xb29cef267cf8e4b1a629f2aaeff8e3b4faf79195efcb63a08e4823070ee85f21",
"receiptsRoot": "0x9290b9bda89e8bc6173f17fab6b94ef7ffb1d33770e5d0fc9e21039ef936c777",
"logsBloom": "0x40330cb14709a3aa3021ae29e85c20249ba3bc0c08bf9c7422cf48124a121120853709b6c20d1261603531d2b8b6810feeb920399c23eb1d8601f14e157921f9ac4b55994f4c3e686a0242ae56ea70ed84fb0b04d6ea1eed11e356cd85609fc3bf310367723a6c1b08453ceecc22d8df13f30504822865610bca1197895e7156a9bfd2756614028c1f5cf5e87bd6a43795c61841abc4d01c6475eae29ad813520b0223401451e9a3fe836ad63e967557cc99030243ad151927d4255e93b7391ed6d29882497108c2044092a24cc68291279b70a7f404ba1139210d5e1c25b40beaf2f48cc341d4c38787169830215105c1f014db5b98ccee22a94d3ba0663c1a",
"timestamp": "0x64d22deb",
"difficulty": "0x0",
"gasLimit": "0x1c9c380",
"gasUsed": "0x1c9b51a",
"baseFeePerGas": "0x3d5200956",
"miner": "0xcda9d71bdfae59b89cee131ed3079f8ac4c77062",
"extraData": "0xd883010c00846765746888676f312e32302e34856c696e7578",
"mixHash": "0x9096c8da5df4b9bb771f91a81c3bd954d2a9c39c1bf05502877d057b1f76fb04",
"nonce": "0x0000000000000000",
"size": "0x0",
"totalDifficulty": "0x0",
"transactions": null,
"uncles": null
}
Overrides for a given contract. In this mapping, the key is the contract address, and the value is an object that contains overrides of nonce, code, balance, or state.
{
"0xdac17f958d2ee523a2206206994597c13d831ec7": {
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828"
}
}
}
The latest L1 block number known to L2. It applies for the Optimism transactions.
100004000
The timestamp of the latest L1 block. It applies for the Optimism transactions.
1686124292
The address of the sender of the latest message from L1 to L2. It applies for the Optimism transactions.
"0x0000000000000000000000000000000000000000"
Indicates if the transaction is a deposit from L1 to L2. It applies for the Optimism Bedrock transactions.
false
Indicates if the transaction is a system-level operation within L2. It applies for the Optimism Bedrock transactions.
false
The amount of a specific token minted within L2. It applies for the Optimism Bedrock transactions.
0
The desired amount to be minted in the next operation. It applies for the Optimism Bedrock transactions.
"0"
Response
A successful response.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Simulation response containing the simulated transaction, simulation metadata, involved contracts, and generated access list.
Contains data related to the simulated transaction, including its hash, block number,
origin and destination addresses, gas details, input data, nonce, status, timestamp,
and involved contract addresses. The nested transaction_info object holds detailed
execution data such as the call trace, emitted logs, state diffs, and asset changes.
Contains metadata about the simulation itself, including its unique ID, project and owner IDs, block number, gas used, the method invoked, simulation status, block header used, and timestamps.
List of contract accounts involved in the simulation. Each entry contains the contract's ID, network ID, address, name, verification status, associated standards (ERC20, ERC721, etc.), token data, compiler version, deployed bytecode, and source code (if verified).
EIP-2930 access list generated by the simulation when generate_access_list
is set to true in the request. Contains addresses and their accessed storage
keys for gas optimization.