Skip to main content
POST
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
vnets
/
{vnetId}
/
transactions
/
simulate
Simulate transaction on Virtual Environment
curl --request POST \
  --url https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/vnets/{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",
    "timestamp": "0x124124"
  },
  "stateOverrides": {
    "0x3F41a1CFd3C8B8d9c162dE0f42307a0095A6e5DF": {
      "balance": "0x124125"
    }
  }
}
'
{
  "blockNumber": "0xfc497b",
  "cumulativeGasUsed": "0x0",
  "gasUsed": "0xb412",
  "logs": [
    {
      "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"
        ]
      }
    }
  ],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000028000000000000000002000000000000000000000010000000000000000004000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000010000000000000000000000000040000000000000000000000000000800000",
  "status": true,
  "trace": [
    {
      "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"
}

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 slug of the user/organization Virtual Environment belongs to

projectSlug
string
required

Project slug of the account

vnetId
string
required

Virtual Environment ID

Body

application/json

Simulation

callArgs
callArgs · object

Call args

Example:
{
  "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
  "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "gas": "0x7a1200",
  "gasPrice": "0x0",
  "value": "0x0",
  "data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
}
blockNumber
string

block number

Example:

"0x124214"

blockOverrides
blockOverrides · object

block overrides

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

Response

A successful response.

blockNumber
string

Block number on which simulation happened

Example:

"0xfc497b"

cumulativeGasUsed
string

Cumulative gas used

Example:

"0x10"

gasUsed
string

Gas Used

Example:

"0xb412"

logs
logs · object[]

Logs of simulation

Example:
[
  {
    "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"
      ]
    }
  }
]
logsBloom
string

Logs bloom filter

Example:

"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000028000000000000000002000000000000000000000010000000000000000004000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000010000000000000000000000000040000000000000000000000000000800000"

status
boolean

status of simulated transaction

Example:

true

trace
trace · object[]

Trace of simulated transaction

Example:
[
  {
    "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
string

type

Example:

"0x0"