Virtual Environments
Simulate Transaction on Environment Virtual Environment
Simulate a transaction on a specific Virtual Environment within an environment instance. State is not preserved. Supports block overrides, state overrides, and a custom block number. The richer response includes asset changes, balance changes, exposure changes, state changes, and cross-chain interop information.
post/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate
Path parameters
accountSlugstring required
Account ID or slug
projectSlugstring required
Project ID or slug
environmentIdstring uuid required
Environment ID
instanceIdstring uuid required
Environment instance ID
vnetIdstring uuid required
Virtual Environment ID
Request body
Example request
{
"callArgs": {
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"gasPrice": "0x0",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
},
"blockNumber": "0x124214",
"blockOverrides": {
"number": "0x124214",
"time": "0x124124"
},
"stateOverrides": {
"0x3F41a1CFd3C8B8d9c162dE0f42307a0095A6e5DF": {
"balance": "0x124125"
}
}
}Response
A successful response.
Example response
{
"blockNumber": "0xfc497b",
"cumulativeGasUsed": "0x10",
"gasUsed": "0xb412",
"status": true,
"type": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"metadata": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"logs": [
{
"name": "Transfer",
"raw": {
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000fa78a211f7df670338daed1f96177c9fe154fcb1",
"0x0000000000000000000000006c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9"
]
},
"inputs": [
{
"name": "from",
"type": "address",
"indexed": true
}
]
}
],
"trace": [
{
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": "0x0",
"gas": "0x6f18c5",
"gasUsed": "0x6da1",
"input": "0xa9059cbb000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f10000000000000000000000000000000000000000000000000de0b6b3a7640000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"method": "transfer",
"error": "Revert",
"errorReason": "ERC20: transfer amount exceeds balance",
"refundAddress": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"subtraces": 1,
"type": "CALL",
"value": "0x0",
"traceAddress": [
0
],
"decodedInput": [
{
"name": "recipient",
"type": "address"
}
],
"decodedOutput": [
{
"type": "bool"
}
]
}
],
"assetChanges": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "Transfer",
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9",
"amount": "1.0",
"rawAmount": "1000000000000000000",
"dollarValue": "2500.00",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"balanceChanges": [
{
"address": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"dollarValue": "-0.05"
}
],
"exposureChanges": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"type": "Approve",
"owner": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"spender": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
"amount": "unlimited",
"rawAmount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"dollarValue": "unlimited",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"stateChanges": [
{
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": {
"previousValue": "0x16345785d8a0000",
"newValue": "0x1bc16d674ec80000"
},
"nonce": {
"previousValue": "0x5",
"newValue": "0x6"
},
"storage": [
{
"slot": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3",
"previousValue": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"newValue": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000"
}
]
}
],
"interopInfo": {
"chainId": "10",
"relayError": "relay failed: insufficient gas",
"transactionAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}