Links

Tenderly Simulation API

Learn more about the Tenderly Transaction Simulation endpoints, featuring detailed requests, responses, and example payloads.

Simulate a transaction

This endpoint allows you to simulate a transaction with different parameters on any of 30+ networks supported by Tenderly. The simulation output shows the emitted events and state changes that this transaction might cause if you sent it to the blockchain.

Endpoint

POST https://api.tenderly.co/api/v1/account/{{accountID}}/project/{{projectID}}/simulate

Request Payload

Transaction request payload with fields and explanation:
Field
Type
Description
Mandatory
Example Value
network_id
string
ID of the network on which the simulation is being run.
Yes
“1”
block_number
number
Number of the block to be used for the simulation.
Yes
17884230
transaction_index
number
Index of the transaction within the block.
No
0
from
string
Address initiating the transaction.
Yes
“0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df”
input
string
Encoded contract method call data.
Yes
“0x…”
to
string
The recipient address of the transaction.
Yes
“0xdef171fe48cf0115b1d80b88dc8eab59176fee57”
gas
number
Amount of gas provided for the simulation.
Yes
648318
gas_price
string
Price of the gas in Wei.
No
“18312000018”
value
string
Amount of Ether (in Wei) sent along with the transaction.
No
“0”
access_list
Object
List of addresses with their storage keys to grant access for this transaction.
No
[{"address": "0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df", "storage_keys": [] }]
save
boolean
Flag indicating whether to save the simulation in dashboard UI.
No
true
save_if_fails
boolean
Flag indicating whether to save failed simulation in dashboard UI.
No
true
simulation_type
string
Opt for quick, abi, or full simulation API mode.
No
“full”
block_header
Object
Details of the block header based on the provided block number.
No
{ "number": "0x110ace7", "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", // ... }
state_objects
Object
Overrides for specific state objects.
No
"0xdac17f958d2ee523a2206206994597c13d831ec7": { "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828" } }

Request Payload Example

Below you can find request payload examples. Replace TENDERLY_ACCOUNT_NAME and TENDERLY_PROJECT_NAME with appropriate values using our platform access guide.
fetch
cURL
JSON
await fetch("https://api.tenderly.co/api/v1/account/{{TENDERLY_ACCOUNT_NAME}}/project/{{TENDERLY_PROJECT_NAME}}/simulate", {
"headers": {
"authorization": "Bearer <TOKEN>",
"content-type": "application/json"
},
"body": "{\"network_id\":\"1\",\"block_number\":17913717,\"transaction_index\":0,\"from\":\"0x0000000000000000000000000000000000000000\",\"input\":\"0x9dc29fac0000000000000000000000003ec7ef9b96a36faa0c0949a2ba804f60d12593dd000000000000000000000000000000000000000000000000000133c2207c0ede\",\"to\":\"0x6b175474e89094c44da98b954eedeac495271d0f\",\"gas\":30000000,\"gas_price\":\"0\",\"value\":\"0\",\"access_list\":[],\"generate_access_list\":true,\"save\":true,\"block_header\":{\"number\":\"0x1115775\",\"hash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"stateRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"parentHash\":\"0xcf515aa3543ac1129b9bb2c140e419427b9edd2c516bbfa5754d4ae7368acade\",\"sha3Uncles\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"transactionsRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"receiptsRoot\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"timestamp\":\"0x64da3b8a\",\"difficulty\":\"0x0\",\"gasLimit\":\"0x1c9c380\",\"gasUsed\":\"0x123b15e\",\"baseFeePerGas\":\"0x1\",\"miner\":\"0x690b9a9e9aa1c9db991c7721a92d351db4fac990\",\"extraData\":\"0x\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000\",\"size\":\"0x0\",\"totalDifficulty\":\"0x0\",\"transactions\":null,\"uncles\":null}}",
"method": "POST"
});
1
curl 'https://api.tenderly.co/api/v1/account/{{TENDERLY_ACCOUNT_NAME}}/project/{{TENDERLY_PROJECT_NAME}}/simulate' \
2
-H 'authorization: Bearer <TOKEN>' \
3
-H 'content-type: application/json' \
4
--data-raw '{"network_id":"1","block_number":17884583,"transaction_index":0,"from":"0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df","input":"0xa94e78ef000000000000000000000000000000000000000000000000000000000000002000000000000000000000000068037790a0229e9ce6eaa8a99ea92964106c470300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000145dc1b2e00000000000000000000000000000000000000000000000000000001477f4d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000064d281e65c9438a5a99c4bccb1035296d5d2d8d200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000320000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a73000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002b68037790a0229e9ce6eaa8a99ea92964106c47030001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a730000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000060000000000000000000000001b81d678ffb9c0263b24a97847620c99d213eb14000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","to":"0xdef171fe48cf0115b1d80b88dc8eab59176fee57","gas":648318,"gas_price":"18312000018","value":"0","access_list":[{"address":"0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df","storage_keys":[]}],"save":true,"save_if_fails":true,"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},"state_objects":{"0xdac17f958d2ee523a2206206994597c13d831ec7":{"storage":{"0x0000000000000000000000000000000000000000000000000000000000000000":"0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828"}}}}' \
5
--compressed
1
{
2
"network_id": "1",
3
"block_number": 17884583,
4
"transaction_index": 0,
5
"from": "0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df",
6
"input": "0xa94e78ef000000000000000000000000000000000000000000000000000000000000002000000000000000000000000068037790a0229e9ce6eaa8a99ea92964106c470300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000145dc1b2e00000000000000000000000000000000000000000000000000000001477f4d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000064d281e65c9438a5a99c4bccb1035296d5d2d8d200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000320000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a73000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002b68037790a0229e9ce6eaa8a99ea92964106c47030001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a730000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000060000000000000000000000001b81d678ffb9c0263b24a97847620c99d213eb14000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
7
"to": "0xdef171fe48cf0115b1d80b88dc8eab59176fee57",
8
"gas": 648318,
9
"gas_price": "18312000018",
10
"value": "0",
11
"access_list": [
12
{
13
"address": "0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df",
14
"storage_keys": []
15
}
16
],
17
"save": true,
18
"save_if_fails": true,
19
"block_header": {
20
"number": "0x110ace7",
21
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
22
"stateRoot": "0xef53217576746e2df5a5acb6993b629e548592008c22e5eb0c543ab0e597102f",
23
"parentHash": "0x0cf8a2db87cf124e1c8fceffd12c325e07fb51736c7dce9d0f945913616cb40a",
24
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
25
"transactionsRoot": "0xb29cef267cf8e4b1a629f2aaeff8e3b4faf79195efcb63a08e4823070ee85f21",
26
"receiptsRoot": "0x9290b9bda89e8bc6173f17fab6b94ef7ffb1d33770e5d0fc9e21039ef936c777",
27
"logsBloom": "0x40330cb14709a3aa3021ae29e85c20249ba3bc0c08bf9c7422cf48124a121120853709b6c20d1261603531d2b8b6810feeb920399c23eb1d8601f14e157921f9ac4b55994f4c3e686a0242ae56ea70ed84fb0b04d6ea1eed11e356cd85609fc3bf310367723a6c1b08453ceecc22d8df13f30504822865610bca1197895e7156a9bfd2756614028c1f5cf5e87bd6a43795c61841abc4d01c6475eae29ad813520b0223401451e9a3fe836ad63e967557cc99030243ad151927d4255e93b7391ed6d29882497108c2044092a24cc68291279b70a7f404ba1139210d5e1c25b40beaf2f48cc341d4c38787169830215105c1f014db5b98ccee22a94d3ba0663c1a",
28
"timestamp": "0x64d22deb",
29
"difficulty": "0x0",
30
"gasLimit": "0x1c9c380",
31
"gasUsed": "0x1c9b51a",
32
"baseFeePerGas": "0x3d5200956",
33
"miner": "0xcda9d71bdfae59b89cee131ed3079f8ac4c77062",
34
"extraData": "0xd883010c00846765746888676f312e32302e34856c696e7578",
35
"mixHash": "0x9096c8da5df4b9bb771f91a81c3bd954d2a9c39c1bf05502877d057b1f76fb04",
36
"nonce": "0x0000000000000000",
37
"size": "0x0",
38
"totalDifficulty": "0x0",
39
"transactions": null,
40
"uncles": null
41
},
42
"state_objects": {
43
"0xdac17f958d2ee523a2206206994597c13d831ec7": {
44
"storage": {
45
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828"
46
}
47
}
48
}
49
}

Response Payload Example

To learn more about different simulation types, refer to the Quick, Abi and Full Mode page. The bellow example is using full simulation type.
Response Explanation
JSON
The response will contain:

Transaction

This field contains detailed information about a specific blockchain transaction. Key details include the transaction hash, block number, originating and destination addresses, gas details, input data, nonce, and other relevant details of the transaction, like the status, timestamp, and involved contract addresses.

Simulation

This section pertains to the simulation of the transaction on a specific blockchain. It offers details like the ID of the simulation, the project and owner IDs, the block number where the transaction was included, gas used, method invoked, the status of the simulation, and some metadata about the block that contains this transaction. It's used to preview the outcome of a transaction before actually committing it to the blockchain, ensuring that the desired result will occur.

Contracts

The contracts field provides in-depth data regarding the contract(s) involved in the transaction. This includes the contract's ID, network ID, balance, verification status, associated standards (like ERC20 in the provided example), token-specific data if the contract is a token, compiler version, and even the source code of the contract in some cases. It's a comprehensive look into the contract's details and specifications.

Generated Access List

An access list is a feature introduced in Ethereum's EIP-2930, which specifies a list of addresses and storage keys that the transaction will access, enabling certain gas cost optimizations. If present, the generated_access_list field would contain such a list generated for the specific transaction, helping in gas optimization and improving the efficiency of the transaction.
1
{
2
"transaction": {
3
"hash": "0xd25e7af24f310141e3adc22d11007203a9cf1589aa1b64f75014fb1f06f2548e",
4
"block_hash": "",
5
"block_number": 17914632,
6
"from": "0x0000000000000000000000000000000000000000",
7
"gas": 8000000,
8
"gas_price": 0,
9
"gas_fee_cap": 0,
10
"gas_tip_cap": 0,
11
"cumulative_gas_used": 0,
12
"gas_used": 21693,
13
"effective_gas_price": 0,
14
"input": "0x06fdde03",
15
"nonce": 0,
16
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
17
"index": 0,
18
"value": "0x",
19
"access_list": [],
20
"status": true,
21
"addresses": [
22
"0x0000000000000000000000000000000000000000",
23
"0x6b175474e89094c44da98b954eedeac495271d0f"
24
],
25
"contract_ids": [
26
"eth:1:0x0000000000000000000000000000000000000000",
27
"eth:1:0x6b175474e89094c44da98b954eedeac495271d0f"
28
],
29
"network_id": "1",
30
"timestamp": "2023-08-14T17:38:47Z",
31
"function_selector": "",
32
"l1_block_number": 0,
33
"l1_timestamp": 0,
34
"deposit_tx": false,
35
"system_tx": false,
36
"sig": {
37
"v": "0x0",
38
"r": "0x0",
39
"s": "0x0"
40
},
41
"transaction_info": {
42
"contract_id": "eth:1:0x6b175474e89094c44da98b954eedeac495271d0f",
43
"block_number": 17914632,
44
"transaction_id": "0xd25e7af24f310141e3adc22d11007203a9cf1589aa1b64f75014fb1f06f2548e",
45
"contract_address": "0x6b175474e89094c44da98b954eedeac495271d0f",
46
"method": "name",
47
"parameters": null,
48
"intrinsic_gas": 21064,
49
"refund_gas": 0,
50
"call_trace": {
51
"hash": "0xd25e7af24f310141e3adc22d11007203a9cf1589aa1b64f75014fb1f06f2548e",
52
"contract_name": "Dai",
53
"function_name": "name",
54
"function_pc": 0,
55
"function_op": "CALL",
56
"absolute_position": 0,
57
"caller_pc": 0,
58
"caller_op": "CALL",
59
"call_type": "CALL",
60
"from": "0x0000000000000000000000000000000000000000",
61
"from_balance": "11746159154279879089501",
62
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
63
"to_balance": "0",
64
"value": "0",
65
"block_timestamp": "0001-01-01T00:00:00Z",
66
"gas": 7978936,
67
"gas_used": 629,
68
"intrinsic_gas": 21064,
69
"event_references": null,
70
"input": "0x06fdde03",
71
"nonce_diff": [
72
{
73
"address": "0x0000000000000000000000000000000000000000",
74
"original": "0",
75
"dirty": "1"
76
}
77
],
78
"output": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e44616920537461626c65636f696e000000000000000000000000000000000000",
79
"decoded_output": [
80
{
81
"soltype": {
82
"name": "",
83
"type": "string",
84
"storage_location": "default",
85
"components": null,
86
"offset": 0,
87
"index": "0x0000000000000000000000000000000000000000000000000000000000000000",
88
"indexed": false,
89
"simple_type": {
90
"type": "string"
91
}
92
},
93
"value": "Dai Stablecoin"
94
}
95
],
96
"network_id": "1",
97
"calls": null
98
},
99
"stack_trace": null,
100
"logs": null,
101
"balance_diff": null,
102
"nonce_diff": [
103
{
104
"address": "0x0000000000000000000000000000000000000000",
105
"original": "0",
106
"dirty": "1"
107
}
108
],
109
"state_diff": null,
110
"raw_state_diff": null,
111
"console_logs": null,
112
"asset_changes": null,
113
"balance_changes": null,
114
"created_at": "2023-08-14T17:38:47Z"
115
},
116
"method": "",
117
"decoded_input": null,
118
"call_trace": [
119
{
120
"call_type": "CALL",
121
"from": "0x0000000000000000000000000000000000000000",
122
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
123
"gas": 7978936,
124
"gas_used": 629,
125
"type": "CALL",
126
"input": "0x06fdde03",
127
"output": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e44616920537461626c65636f696e000000000000000000000000000000000000",
128
"fromBalance": "0x027cc2b44cffc6f51d5d"
129
}
130
]
131
},
132
"simulation": {
133
"id": "c06319b8-55b8-48eb-935e-3d7f338cb9af",
134
"project_id": "1830efff-aa75-481e-b464-cedaf8b90960",
135
"owner_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
136
"network_id": "1",
137
"block_number": 17914632,
138
"transaction_index": 0,
139
"from": "0x0000000000000000000000000000000000000000",
140
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
141
"input": "0x06fdde03",
142
"gas": 8000000,
143
"gas_price": "0",
144
"gas_used": 21693,
145
"value": "0",
146
"method": "name",
147
"status": true,
148
"access_list": null,
149
"queue_origin": "",
150
"block_header": {
151
"number": "0x1115b08",
152
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
153
"stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
154
"parentHash": "0x83c670e91707242099e6f5315543d581b1d6ef7ffde829f50d1b3af4b7942713",
155
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
156
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
157
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
158
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
159
"timestamp": "0x64da66a7",
160
"difficulty": "0x0",
161
"gasLimit": "0x1c9c380",
162
"gasUsed": "0xc790ea",
163
"miner": "0xcda9d71bdfae59b89cee131ed3079f8ac4c77062",
164
"extraData": "0x",
165
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
166
"nonce": "0x0000000000000000",
167
"baseFeePerGas": "0x1",
168
"size": "0x0",
169
"totalDifficulty": "0x0",
170
"uncles": null,
171
"transactions": null
172
},
173
"deposit_tx": false,
174
"system_tx": false,
175
"nonce": 0,
176
"addresses": [
177
"0x0000000000000000000000000000000000000000",
178
"0x6b175474e89094c44da98b954eedeac495271d0f"
179
],
180
"contract_ids": [
181
"eth:1:0x0000000000000000000000000000000000000000",
182
"eth:1:0x6b175474e89094c44da98b954eedeac495271d0f"
183
],
184
"shared": false,
185
"created_at": "2023-08-15T09:29:22.779602208Z"
186
},
187
"contracts": [
188
{
189
"id": "eth:1:0x6b175474e89094c44da98b954eedeac495271d0f",
190
"contract_id": "eth:1:0x6b175474e89094c44da98b954eedeac495271d0f",
191
"balance": "",
192
"network_id": "1",
193
"public": true,
194
"export": false,
195
"verified_by": "etherscan",
196
"verification_date": null,
197
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
198
"contract_name": "Dai",
199
"ens_domain": null,
200
"type": "contract",
201
"standard": "erc20",
202
"standards": [
203
"erc20"
204
],
205
"token_data": {
206
"symbol": "dai",
207
"name": "Dai",
208
"decimals": 18
209
},
210
"evm_version": "",
211
"compiler_version": "v0.5.12+commit.7709ece9",
212
"optimizations_used": false,
213
"optimization_runs": 200,
214
"libraries": null,
215
"data": {
216
"main_contract": 0,
217
"contract_info": [
218
{
219
"id": 0,
220
"path": "Dai.sol",
221
"name": "Dai.sol",
222
"source": "// hevm: flattened sources of /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/dai.sol\npragma solidity =0.5.12;\n\n////// /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/lib.sol\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n/* pragma solidity 0.5.12; */\n\ncontract LibNote {\n event LogNote(\n bytes4 indexed sig,\n address indexed usr,\n bytes32 indexed arg1,\n bytes32 indexed arg2,\n bytes data\n ) anonymous;\n\n modifier note {\n _;\n assembly {\n // log an 'anonymous' event with a constant 6 words of calldata\n // and four indexed topics: selector, caller, arg1 and arg2\n let mark := msize // end of memory ensures zero\n mstore(0x40, add(mark, 288)) // update free memory pointer\n mstore(mark, 0x20) // bytes type data offset\n mstore(add(mark, 0x20), 224) // bytes size (padded)\n calldatacopy(add(mark, 0x40), 0, 224) // bytes payload\n log4(mark, 288, // calldata\n shl(224, shr(224, calldataload(0))), // msg.sig\n caller, // msg.sender\n calldataload(4), // arg1\n calldataload(36) // arg2\n )\n }\n }\n}\n\n////// /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/dai.sol\n// Copyright (C) 2017, 2018, 2019 dbrock, rain, mrchico\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n\n/* pragma solidity 0.5.12; */\n\n/* import \"./lib.sol\"; */\n\ncontract Dai is LibNote {\n // --- Auth ---\n mapping (address => uint) public wards;\n function rely(address guy) external note auth { wards[guy] = 1; }\n function deny(address guy) external note auth { wards[guy] = 0; }\n modifier auth {\n require(wards[msg.sender] == 1, \"Dai/not-authorized\");\n _;\n }\n\n // --- ERC20 Data ---\n string public constant name = \"Dai Stablecoin\";\n string public constant symbol = \"DAI\";\n string public constant version = \"1\";\n uint8 public constant decimals = 18;\n uint256 public totalSupply;\n\n mapping (address => uint) public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n mapping (address => uint) public nonces;\n\n event Approval(address indexed src, address indexed guy, uint wad);\n event Transfer(address indexed src, address indexed dst, uint wad);\n\n // --- Math ---\n function add(uint x, uint y) internal pure returns (uint z) {\n require((z = x + y) >= x);\n }\n function sub(uint x, uint y) internal pure returns (uint z) {\n require((z = x - y) <= x);\n }\n\n // --- EIP712 niceties ---\n bytes32 public DOMAIN_SEPARATOR;\n // bytes32 public constant PERMIT_TYPEHASH = keccak256(\"Permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed)\");\n bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb;\n\n constructor(uint256 chainId_) public {\n wards[msg.sender] = 1;\n DOMAIN_SEPARATOR = keccak256(abi.encode(\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"),\n keccak256(bytes(name)),\n keccak256(bytes(version)),\n chainId_,\n address(this)\n ));\n }\n\n // --- Token ---\n function transfer(address dst, uint wad) external returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n function transferFrom(address src, address dst, uint wad)\n public returns (bool)\n {\n require(balanceOf[src] >= wad, \"Dai/insufficient-balance\");\n if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {\n require(allowance[src][msg.sender] >= wad, \"Dai/insufficient-allowance\");\n allowance[src][msg.sender] = sub(allowance[src][msg.sender], wad);\n }\n balanceOf[src] = sub(balanceOf[src], wad);\n balanceOf[dst] = add(balanceOf[dst], wad);\n emit Transfer(src, dst, wad);\n return true;\n }\n function mint(address usr, uint wad) external auth {\n balanceOf[usr] = add(balanceOf[usr], wad);\n totalSupply = add(totalSupply, wad);\n emit Transfer(address(0), usr, wad);\n }\n function burn(address usr, uint wad) external {\n require(balanceOf[usr] >= wad, \"Dai/insufficient-balance\");\n if (usr != msg.sender && allowance[usr][msg.sender] != uint(-1)) {\n require(allowance[usr][msg.sender] >= wad, \"Dai/insufficient-allowance\");\n allowance[usr][msg.sender] = sub(allowance[usr][msg.sender], wad);\n }\n balanceOf[usr] = sub(balanceOf[usr], wad);\n totalSupply = sub(totalSupply, wad);\n emit Transfer(usr, address(0), wad);\n }\n function approve(address usr, uint wad) external returns (bool) {\n allowance[msg.sender][usr] = wad;\n emit Approval(msg.sender, usr, wad);\n return true;\n }\n\n // --- Alias ---\n function push(address usr, uint wad) external {\n transferFrom(msg.sender, usr, wad);\n }\n function pull(address usr, uint wad) external {\n transferFrom(usr, msg.sender, wad);\n }\n function move(address src, address dst, uint wad) external {\n transferFrom(src, dst, wad);\n }\n\n // --- Approve by signature ---\n function permit(address holder, address spender, uint256 nonce, uint256 expiry,\n bool allowed, uint8 v, bytes32 r, bytes32 s) external\n {\n bytes32 digest =\n keccak256(abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH,\n holder,\n spender,\n nonce,\n expiry,\n allowed))\n ));\n\n require(holder != address(0), \"Dai/invalid-address-0\");\n require(holder == ecrecover(digest, v, r, s), \"Dai/invalid-permit\");\n require(expiry == 0 || now <= expiry, \"Dai/permit-expired\");\n require(nonce == nonces[holder]++, \"Dai/invalid-nonce\");\n uint wad = allowed ? uint(-1) : 0;\n allowance[holder][spender] = wad;\n emit Approval(holder, spender, wad);\n }\n}"
223
}
224
],
225
"abi": [
226
{
227
"type": "constructor",
228
"name": "",
229
"constant": false,
230
"anonymous": false,
231
"stateMutability": "",
232
"inputs": [
233
{
234
"name": "chainId_",
235
"type": "uint256",
236
"storage_location": "default",
237
"components": null,
238
"offset": 0,
239
"index": "0x0000000000000000000000000000000000000000000000000000000000000000",
240
"indexed": false,
241
"simple_type": {
242
"type": "uint"
243
}
244
}
245
],
246
"outputs": null
247
},
248
{
249
"type": "function",
250
"name": "decimals",
251
"constant": true,
252
"anonymous": false,
253
"stateMutability": "view",
254
"inputs": [],
255
"outputs": [
256
{
257
"name": "",
258
"type": "uint8",
259
"storage_location": "default",
260
"components": null,
261
"offset": 0,
262
"index": "0x0000000000000000000000000000000000000000000000000000000000000000",
263
"indexed": false,
264
"simple_type": {
265
"type": "uint"
266
}
267
}
268
]
269
}
270
],
271
"raw_abi": [
272
{
273
"inputs": [
274
{
275
"internalType": "uint256",
276
"name": "chainId_",
277
"type": "uint256"
278
}
279
],
280
"payable": false,
281
"stateMutability": "nonpayable",
282
"type": "constructor"
283
},
284
{
285
"anonymous": false,
286
"inputs": [
287
{
288
"indexed": true,
289
"internalType": "address",
290
"name": "src",
291
"type": "address"
292
},
293
{
294
"indexed": true,
295
"internalType": "address",
296
"name": "guy",
297
"type": "address"
298
},
299
{
300
"indexed": false,
301
"internalType": "uint256",
302
"name": "wad",
303
"type": "uint256"
304
}
305
],
306
"name": "Approval",
307
"type": "event"
308
}
309
],
310
"states": [
311
{
312
"name": "nonces",
313
"type": "mapping (address => uint256)",
314
"storage_location": "storage",
315
"components": null,
316
"offset": 0,
317
"index": "0x0000000000000000000000000000000000000000000000000000000000000004",
318
"indexed": false
319
},
320
{
321
"name": "DOMAIN_SEPARATOR",
322
"type": "bytes32",
323
"storage_location": "storage",
324
"components": null,
325
"offset": 0,
326
"index": "0x0000000000000000000000000000000000000000000000000000000000000005",
327
"indexed": false,
328
"simple_type": {
329
"type": "bytes"
330
}
331
},
332
{
333
"name": "wards",
334
"type": "mapping (address => uint256)",
335
"storage_location": "storage",
336
"components": null,
337
"offset": 0,
338
"index": "0x0000000000000000000000000000000000000000000000000000000000000000",
339
"indexed": false
340
},
341
{
342
"name": "totalSupply",
343
"type": "uint256",
344
"storage_location": "storage",
345
"components": null,
346
"offset": 0,
347
"index": "0x0000000000000000000000000000000000000000000000000000000000000001",
348
"indexed": false,
349
"simple_type": {
350
"type": "uint"
351
}
352
},
353
{
354
"name": "balanceOf",
355
"type": "mapping (address => uint256)",
356
"storage_location": "storage",
357
"components": null,
358
"offset": 0,
359
"index": "0x0000000000000000000000000000000000000000000000000000000000000002",
360
"indexed": false
361
},
362
{
363
"name": "allowance",
364
"type": "mapping (address => mapping (address => uint256))",
365
"storage_location": "storage",
366
"components": null,
367
"offset": 0,
368
"index": "0x0000000000000000000000000000000000000000000000000000000000000003",
369
"indexed": false
370
}
371
]
372
},
373
"creation_block": 0,
374
"creation_tx": "",
375
"creator_address": "",
376
"created_at": "2023-07-27T11:32:46Z",
377
"language": "solidity",
378
"in_project": false
379
}
380
],
381
"generated_access_list": []
382
}

Optimism Request Payload

Transaction payload for the Optimism network has additional fields you can use inside the API.
Field
Type
Description
Mandatory
Example Value
l1_block_number
number
The latest L1 block number known to L2
No
100004000
l1_timestamp
number
The timestamp of the latest L1 block
No
1686124292
l1_message_sender
string
The address of the sender of the latest message from L1 to L2.
No
“0x0000000000000000000000000000000000000000”
deposit_tx
boolean
Indicates if the transaction is a deposit from L1 to L2. It applies for the Bedrock transactions.
No
false
system_tx
boolean
Indicates if the transaction is a system-level operation within L2. It applies for the Bedrock transactions.
No
false
mint
number
The amount of a specific token minted within L2. It applies for the Bedrock transactions.
No
0
amount_to_mint
string
The desired amount to be minted in the next operation. It applies for the Bedrock transactions.
No
“0”

Optimism Request Payload Example

Replace TENDERLY_ACCOUNT_NAME and TENDERLY_PROJECT_NAME with appropriate values using our platform access guide.
fetch
cURL
JSON
1
await fetch("https://api.tenderly.co/api/v1/account/{{TENDERLY_ACCOUNT_NAME}}/project/{{TENDERLY_PROJECT_NAME}}/simulate", {
2
"headers": {
3
"authorization": "Bearer <TOKEN>",
4
"content-type": "application/json"
5
},
6
"body": "{\"network_id\":\"10\",\"block_number\":null,\"transaction_index\":null,\"from\":\"0x0000000000000000000000000000000000000000\",\"input\":\"0x8da5cb5b\",\"to\":\"0x11111112542d85b3ef69ae05771c2dccff4faa26\",\"gas\":8000000,\"gas_price\":\"0\",\"value\":\"0\",\"access_list\":[],\"generate_access_list\":true,\"save\":true,\"block_header\":null,\"l1_block_number\":null,\"l1_timestamp\":null,\"l1_message_sender\":\"0x0000000000000000000000000000000000000000\",\"deposit_tx\":false,\"mint\":0,\"amount_to_mint\":\"0\"}",
7
"method": "POST"
8
});
1
curl 'https://api.tenderly.co/api/v1/account/{{TENDERLY_ACCOUNT_NAME}}/project/{{TENDERLY_PROJECT_NAME}}/simulate' \
2
-H 'authorization: Bearer <TOKEN>' \
3
-H 'content-type: application/json' \
4
--data-raw '{"network_id":"10","block_number":null,"transaction_index":null,"from":"0x0000000000000000000000000000000000000000","input":"0x8da5cb5b","to":"0x11111112542d85b3ef69ae05771c2dccff4faa26","gas":8000000,"gas_price":"0","value":"0","access_list":[],"generate_access_list":true,"save":true,"block_header":null,"l1_block_number":null,"l1_timestamp":null,"l1_message_sender":"0x0000000000000000000000000000000000000000","deposit_tx":false,"mint":0,"amount_to_mint":"0"}' \
5
--compressed
1
{
2
"network_id": "10",
3
"block_number": null,
4
"transaction_index": null,
5
"from": "0x0000000000000000000000000000000000000000",
6
"input": "0x8da5cb5b",
7
"to": "0x11111112542d85b3ef69ae05771c2dccff4faa26",
8
"gas": 8000000,
9
"gas_price": "0",
10
"value": "0",
11
"access_list": [],
12
"generate_access_list": true,
13
"save": true,
14
"block_header": null,
15
"l1_block_number": null,
16
"l1_timestamp": null,
17
"l1_message_sender": "0x0000000000000000000000000000000000000000",
18
"deposit_tx": false,
19
"mint": 0,
20
"amount_to_mint": "0"
21
}

Optimism Response Payload Example

Response Explanation
JSON
The response will have the same fields as presented in Response Payload Example.
{
"transaction": {
"hash": "0xec0729ed71507155212ea5942ac8a4f0a6e7559c6aa0426353e00b0f751b62f5",
"block_hash": "",
"block_number": 108334091,
"from": "0x0000000000000000000000000000000000000000",
"gas": 8000000,
"gas_price": 0,
"gas_fee_cap": 0,
"gas_tip_cap": 0,
"cumulative_gas_used": 0,
"gas_used": 23432,
"effective_gas_price": 0,
"input": "0x8da5cb5b",
"nonce": 0,
"to": "0x11111112542d85b3ef69ae05771c2dccff4faa26",
"index": 0,
"value": "0x",
"access_list": [],
"status": true,
"addresses": [
"0x0000000000000000000000000000000000000000",
"0x11111112542d85b3ef69ae05771c2dccff4faa26"
],
"contract_ids": [
"eth:10:0x0000000000000000000000000000000000000000",
"eth:10:0x11111112542d85b3ef69ae05771c2dccff4faa26"
],
"network_id": "10",
"timestamp": "2023-08-17T10:09:18Z",
"function_selector": "",
"l1_message_sender": "0x0000000000000000000000000000000000000000",
"l1_block_number": 0,
"l1_timestamp": 0,
"deposit_tx": false,
"system_tx": false,
"mint": 0,
"sig": {
"v": "0x0",
"r": "0x0",
"s": "0x0"
},
"transaction_info": {
"contract_id": "eth:10:0x11111112542d85b3ef69ae05771c2dccff4faa26",
"block_number": 108334091,
"transaction_id": "0xec0729ed71507155212ea5942ac8a4f0a6e7559c6aa0426353e00b0f751b62f5",
"contract_address": "0x11111112542d85b3ef69ae05771c2dccff4faa26",
"method": "owner",
"parameters": null,
"intrinsic_gas": 21064,
"refund_gas": 0,
"call_trace": {
"hash": "0xec0729ed71507155212ea5942ac8a4f0a6e7559c6aa0426353e00b0f751b62f5",
"contract_name": "AggregationRouterV3",
"function_name": "owner",
"function_pc": 0,
"function_op": "CALL",
"absolute_position": 0,