Simulate transaction on Virtual Environment
Send transaction to simulation. State will not be preserved. You will be able to override simulation with block overrides and state overrides. Also you will be able to simulate transaction on custom blockNumber.
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/organization Virtual Environment belongs to
Project slug of the account
Virtual Environment ID
Body
Simulation
Call args
{
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"gasPrice": "0x0",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
}
block number
"0x124214"
block overrides
{
"number": "0x124214",
"timestamp": "0x124124"
}
Response
A successful response.
Block number on which simulation happened
"0xfc497b"
Cumulative gas used
"0x10"
Gas Used
"0xb412"
Logs of simulation
[
{
"anonymous": false,
"inputs": [
{
"name": "src",
"type": "address",
"value": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2"
},
{
"name": "guy",
"type": "address",
"value": "0xf1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1"
},
{
"name": "wad",
"type": "uint256",
"value": "299"
}
],
"name": "Approval",
"raw": {
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0x000000000000000000000000000000000000000000000000000000000000012b",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x000000000000000000000000e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"0x000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1"
]
}
}
]
Logs bloom filter
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000028000000000000000002000000000000000000000010000000000000000004000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000010000000000000000000000000040000000000000000000000000000800000"
status of simulated transaction
true
Trace of simulated transaction
[
{
"decodedInput": [
{
"name": "usr",
"type": "address",
"value": "0xf1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1"
},
{
"name": "wad",
"type": "uint256",
"value": "299"
}
],
"decodedOutput": [
{
"name": "",
"type": "boolean",
"value": true
}
],
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"gas": "0x79bdb0",
"gasUsed": "0x5fc2",
"input": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b",
"method": "approve",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"subtraces": 0,
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"traceAddress": [0],
"type": "CALL",
"value": "0x0"
}
]
type
"0x0"