Skip to main content
POST
/
public
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
environments
/
{environmentId}
/
instance
/
{instanceId}
/
vnet
/
{vnetId}
/
transactions
/
simulate
Simulate Transaction on Environment Virtual TestNet
curl --request POST \
  --url https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Key: <api-key>' \
  --data '
{
  "callArgs": {
    "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
    "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
    "gas": "0x7a1200",
    "gasPrice": "0x0",
    "value": "0x0",
    "data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
  },
  "blockNumber": "0x124214",
  "blockOverrides": {
    "number": "0x124214",
    "time": "0x124124"
  },
  "stateOverrides": {
    "0x3F41a1CFd3C8B8d9c162dE0f42307a0095A6e5DF": {
      "balance": "0x124125"
    }
  }
}
'
{
  "blockNumber": "0xfc497b",
  "cumulativeGasUsed": "0x10",
  "gasUsed": "0xb412",
  "status": true,
  "type": "0x0",
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "metadata": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  },
  "logs": [
    {
      "name": "Transfer",
      "anonymous": false,
      "raw": {
        "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
        "topics": [
          "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0x000000000000000000000000fa78a211f7df670338daed1f96177c9fe154fcb1",
          "0x0000000000000000000000006c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9"
        ]
      },
      "inputs": [
        {
          "name": "from",
          "type": "address",
          "value": "<unknown>",
          "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",
          "value": "<unknown>",
          "indexed": false
        }
      ],
      "decodedOutput": [
        {
          "name": "<string>",
          "type": "bool",
          "value": "<unknown>",
          "indexed": false
        }
      ]
    }
  ],
  "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"
  }
}

Authorizations

X-Access-Key
string
header
required

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

accountSlug
string
required

Account ID or slug

projectSlug
string
required

Project ID or slug

environmentId
string<uuid>
required

Environment ID

instanceId
string<uuid>
required

Environment instance ID

vnetId
string<uuid>
required

Virtual TestNet ID

Body

application/json

Simulation parameters

callArgs
callArgs · object

Transaction call arguments

blockNumber
string

Block number on which the transaction is simulated (hex-encoded)

Example:

"0x151924A"

blockOverrides
blockOverrides · object

Overrides for block data

Example:
{ "number": "0x124214", "time": "0x124124" }
stateOverrides
stateOverrides · object

Overrides of account state. In this mapping, the key is the address of the account, and the value contains the override.

Response

A successful response.

Result of simulating a transaction on an environment Virtual TestNet

blockNumber
string

Block number on which the simulation was executed (hex-encoded)

Example:

"0xfc497b"

cumulativeGasUsed
string

Cumulative gas used up to and including this transaction in the block (hex-encoded)

Example:

"0x10"

gasUsed
string

Gas consumed by this transaction (hex-encoded)

Example:

"0xb412"

status
boolean

Whether the simulated transaction succeeded

Example:

true

type
string

Transaction type (hex-encoded)

Example:

"0x0"

logsBloom
string

Bloom filter of all logs emitted during simulation (hex-encoded)

Example:

"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

metadata
metadata · object

Simulation metadata

logs
decodedLog · object[]

ABI-decoded logs emitted during simulation

trace
traceResponse · object[]

Execution trace call tree

assetChanges
assetChange · object[]

Token transfers that occurred during simulation

balanceChanges
balanceChange · object[]

Native ETH balance changes during simulation

exposureChanges
exposureChange · object[]

Token approval and allowance changes during simulation

stateChanges
stateChange · object[]

Account and storage state changes during simulation

interopInfo
interopInfo · object

Cross-chain interoperability information (only present for cross-chain simulations)