> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate bundled transactions

> Call the `simulate-bundle` endpoint to simulate multiple consecutive transactions at once. You can simulate bundled transactions on real-time data from over [105+ supported networks](https://docs.tenderly.co/supported-networks-and-languages). This endpoint receive an array of transactions that get simulated one after another on the same block.

**Note:** If the initial transaction in the array changes the state, all subsequent transactions will be simulated against this modified state. Furthermore, should a simulation fail for any reason, all following simulations in the sequence will not be executed.

Learn more about [bundled simulations](https://docs.tenderly.co/simulations/bundled-simulations).

The response returns a `simulation_results` array, where each element corresponds to a simulation in the input array (in the same order). Each result contains the following objects:

`transaction`: Contains data related to the simulated transaction, including its hash, block number, origin and destination addresses, gas details, input data, nonce, and other transaction details, like the status, timestamp, and involved contract addresses. The nested `transaction_info` object holds detailed execution data such as the call trace, emitted logs, state diffs, and asset changes.

`simulation`: Contains metadata about this simulation within the bundle, including its unique ID, project and owner IDs, block number, gas used, the method invoked, simulation status, state overrides applied, and other metadata.

`contracts`: Contains data about the contract(s) involved in the transaction, including the contract's ID, network ID, balance, verification status, associated standards (like ERC20), token-specific data if the contract is a token, compiler version, and even the source code of the contract in some cases.

`generated_access_list`: Contains a list of addresses and storage keys that the transaction will access, enabling certain gas cost optimizations. The access list is a feature introduced in [Ethereum's EIP-2930](https://eips.ethereum.org/EIPS/eip-2930).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/account/{accountSlug}/project/{projectSlug}/simulate-bundle
openapi: 3.1.0
info:
  version: 1.0.0
  title: Tenderly API
  description: >
    # Introduction


    The Tenderly API provides a programmatic interface for managing Tenderly
    resources using standard HTTP requests.

    It mirrors many functionalities available through the Tenderly Dashboard,
    enabling you to script complex actions. The API documentation includes a
    design and technology overview, followed by detailed endpoint information.


    [Log into your Tenderly account](https://dashboard.tenderly.co/login) to
    automatically populate your API credentials in the documentation. Your
    account ID and project slug will be pre-filled across the documentation,
    excluding the API access token for security reasons. 


    Base URL: `https://api.tenderly.co/api`


    ## Authentication


    The Tenderly API requires an access token to authenticate your requests.
    Learn how to [generate and manage your API access
    keys](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token).


    Add `X-Access-Key` to each request header, e.g.:


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      ...
    ```


    Do not share your secret API keys in publicly accessible areas such as
    GitHub, client-side code, and so forth.


    Authentication to the API is performed via HTTP Basic Auth. Provide your API
    key as the basic auth username value. You do not need to provide a password.


    If you need to authenticate via bearer auth (e.g., for a cross-origin
    request), use:


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'Authorization: Bearer <TENDERLY_TOKEN>' \
      ...
    ```


    All API requests must be made over HTTPS. Calls made over plain HTTP will
    fail. API requests without authentication will also fail.


    ## Requests


    Any tool capable of making HTTP requests can interact with the API by
    requesting the appropriate URI. Requests should be made using the HTTPS
    protocol to ensure that traffic is encrypted. 


    The API's response varies with the request method used.


    |Method|Usage|

    |--- |--- |

    |GET|Used to retrieve information about your account, project, or resources.
    The requested information is returned as a JSON object. The attributes
    defined by the JSON object can be used to form additional requests. Requests
    made using the GET method are read-only and will not affect the objects you
    are querying.|

    |DELETE|Used to destroy a resource and remove it from your account and
    project. This methods removes the specified object if it is found. If it is
    not found, the operation will return a response indicating that the object
    was not found. You do not have to check if the resource is available prior
    to issuing a DELETE command. The final state will be the same regardless of
    its existence.|

    |PUT|Used to update the information about a resource in your account. The
    PUT method sets the state of the target using the provided values,
    regardless of their current values. Requests using the PUT method do not
    need to check the current attributes of the object.|

    |PATCH|Some resources support partial modification. In these cases, the
    PATCH method is available. Unlike PUT which generally requires a complete
    representation of a resource, a PATCH request is a set of instructions on
    how to modify a resource updating only specific attributes.|

    |POST|Used to create a new object. The POST request includes all of the
    attributes necessary to create a new object.|


    ## Errors


    The API responds with standard HTTP statuses, including error codes that
    indicate the outcome of requests. In the event of a problem, the status will
    contain the error code, while the

    body of the response will usually contain additional information about the
    problem.


    |Status Code|Type|Description|

    |--- |--- |--- |

    |200|OK|Everything worked as expected.|

    |400|Bad Request|The request was unacceptable, often due to missing a
    required parameter.|

    |401|Unauthorized|No valid API key provided.|

    |402|Request Failed|The parameters were valid but the request failed.|

    |403|Forbidden|The API key doesn’t have permissions to perform the request.|

    |404|Not Found|The requested resource doesn’t exist.|

    |429|Too Many Requests|Too many requests hit the API too quickly. We
    recommend an exponential backoff of your requests.|

    |500, 502, 503, 504|Server Errors|Something went wrong on Tenderly’s end.|


    Both 400 and 500 level errors return a JSON object in the response body,
    containing specific attributes detailing the error.


    |Name|Type|Description|

    |--- |--- |--- |

    |id|string|Endpoints include an error ID that should be provided when
    reporting bugs or opening support tickets to help identify the issue.|

    |slug|string|A short identifier corresponding to the HTTP status code
    returned. For example, the ID for a response returning a 404 status code
    would be "not_found."|

    |message|string|A message providing additional information about the error,
    including details to help resolve it when possible.|


    ### Example error response


    HTTP/1.1 404 Bad request

    ```json

    {

    "error": {
      "id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
      "slug": "bad_request",
      "message": "Bad request input parameters"
     }
    }

    ```


    ## Responses


    When a request is successful, a response body will typically be sent back in

    the form of a JSON object. An exception to this is when a DELETE request is

    processed, which will result in a successful HTTP 204 status and an empty

    response body.


    The value of these keys will generally be a JSON object for a request on a

    single object and an array of objects for a request on a collection of

    objects.


    ### Response for a single object


    ```json

    {
      "simulation": {
        "id": "123"
        "...": "..."
      }
    }

    ```


    ### Response for an object collection


    ```json

    {
      "simulations": [
        {
          "id": "123"
          "...": "..."
        },
        {
          "id": "1234"
          "...": "..."
        }
      ]
    }

    ```


    ## Pagination


    By default, 20 objects are returned per page per request.

    You can customize this behavior using the following parameters:


    * **Pagination Limit (perPage)**: To change the number of items per page,

    append `?perPage=[number]` to your request. For example, `?perPage=2` limits

    the results to two items per page. The maximum limit is 100 items per page.

    * **Page Offset (page)**: To navigate through paginated results, use the

    `?page=[number]` parameter. For instance, `?page=3` will take you to the
    third page of the results.

    Only positive integers are valid for this parameter.


    Remember:


    * You can combine these parameters. For example, `?perPage=10&page=2` will
    show the second page with 10 items per page.

    * The maximum number of results per page (`perPage`) is 100.


    ## Rate limits


    Requests through the API are rate limited per `X-Access-Key` API key.
    Current rate limits:


    * **Non-authenticated users:** 100 requests per minute

    * **Authenticated users:** 400 requests per minute


    Once you exceed either limit, you will be rate limited until the next cycle

    starts. Space out any requests that you would otherwise issue in bursts for

    the best results.


    The rate limiting information is contained within the response headers of

    each request. The relevant headers are:


    * **X-Tdly-Limit**: The number of requests that can be made per minute.

    * **X-Tdly-Remaining**: The number of requests that remain before you hit
    your request limit. See the information below for how the request limits
    expire.

    * **X-Tdly-Reset-Timestamp**: This represents the time when the oldest
    request will expire. The value is given in [Unix epoch
    time](http://en.wikipedia.org/wiki/Unix_time). See below for more
    information about how request limits expire.


    As long as the `X-Tdly-Remaining` count is above zero, you will be able

    to make additional requests.


    The way that a request expires and is removed from the current limit count

    is important to understand. Rather than counting all of the requests for a

    minute and resetting the `X-Tdly-Remaining` value at the end of the minute,

    each request instead has its own timer.


    This means that each request contributes toward the `X-Tdly-Remaining`

    count for one complete minute after the request is made. When that request's

    timer runs out, it is no longer counted toward the request limit.


    This has implications on the meaning of the `X-Tdly-Reset-Timestamp` header
    as

    well. Because the entire rate limit is not reset at one time, the value of

    this header is set to the time when the _oldest_ request will expire.


    Keep this in mind if you see your `X-Tdly-Reset-Timestamp` value change, but
    not

    move an entire minute into the future.


    If the `X-Tdly-Remaining` reaches zero, subsequent requests will receive

    a 429 error code until the request reset has been reached. 


    `X-Tdly-Remaining` reaching zero can also indicate that the "burst limit" of
    250 

    requests per minute limit was met, even if the 400 requests per minute limit
    was not. 


    You can see the format of the response in the examples. 


    **Note:** Some endpoints may have special rate limit requirements that

    are independent of the limits defined above.


    ### Sample rate limit headers


    ```bash

    'X-Tdly-Limit': 100

    'X-Tdly-Remaining': 79

    'X-Tdly-Reset-Timestamp': 1402425459

    ```


    ### Sample rate exceeded response


    429 Too Many Requests

    ```bash

    {
      id: "too_many_requests",
      message: "API Rate limit exceeded."
    }

    ```


    ## Parameters


    There are two different ways to pass parameters in a request to the API.


    When passing parameters to create or update an object, parameters should be

    passed as a JSON object containing the appropriate attribute names and

    values as key-value pairs. When you use this format, you should specify that

    you are sending a JSON object in the header. This is done by setting the

    `Content-Type` header to `application/json`. This ensures that your request

    is interpreted correctly.


    When passing parameters to filter a response on GET requests, parameters can

    be passed using standard query attributes. In this case, the parameters

    would be embedded into the URI itself by appending a `?` to the end of the

    URI and then setting each attribute with an equal sign. Attributes can be

    separated with a `&`. Tools like `curl` can create the appropriate URI when

    given parameters and values; this can also be done using the `-F` flag and

    then passing the key and value as an argument. The argument should take the

    form of a quoted string with the attribute being set to a value with an

    equal sign.


    ### Pass parameters as a JSON object


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      -H 'content-type: application/json' \
      --data-raw '{"network_id":"1","block_number":null,"transaction_index":null,"from":"0x0000000000000000000000000000000000000000","input":"0x42966c68000000000000000000000000000000000000000000000000000000000000022b","to":"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c","gas":8000000,"gas_price":"0","value":"0","access_list":[],"generate_access_list":true,"save":true,"block_header":null}' \
      --compressed
    ```


    ### Pass filter parameters as a query string


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulations?page=1&perPage=20'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      --compressed
    ```


    ## Cross origin resource sharing


    In order to make requests to the API from other domains, the API implements

    Cross Origin Resource Sharing (CORS) support.


    CORS support is generally used to create AJAX requests outside of the domain

    that the request originated from. This is necessary to implement projects

    like control panels utilizing the API. This tells the browser that it can

    send requests to an outside domain.


    The procedure that the browser initiates in order to perform these actions

    (other than GET requests) begins by sending a "preflight" request. This sets

    the `Origin` header and uses the `OPTIONS` method. The server will reply

    with the methods it allows and some of the limits it imposes. The

    client then sends the actual request if it falls within the allowed

    constraints.


    This process is usually done by the browser in the background, but you can

    use curl to emulate this process. The headers that will be set to show the
    constraints are:


    * **Access-Control-Allow-Origin**: This is the domain that is sent by the
    client or browser as the origin of the request. It is set through an
    `Origin` header.

    * **Access-Control-Allow-Methods**: This specifies the allowed options for
    requests from that domain. This will generally be all available methods.

    * **Access-Control-Expose-Headers**: This will contain the headers that will
    be available to requests from the origin domain.

    * **Access-Control-Max-Age**: This is the length of time that the access is
    considered valid. After this expires, a new preflight should be sent.

    * **Access-Control-Allow-Credentials**: This will be set to `true`. It
    basically allows you to send your Access token for authentication.


    You should not need to be concerned with the details of these headers,

    because the browser will typically do all of the work for you.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: Tenderly Support
    email: support@tenderly.co
  termsOfService: https://tenderly.co/terms-of-service
servers:
  - url: https://api.tenderly.co/api
    description: production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Contracts
    description: >-
      Tenderly allows you to add verified and unverified smart contracts to your
      project to use in development. Once you add a contract, you can start
      inspecting and debugging transactions, simulating transactions with
      modified parameters, or monitoring contract usage.


      Learn more about managing [Smart
      Contracts](https://docs.tenderly.co/monitoring/smart-contracts).
  - name: Wallets
    description: >-
      Similar to contracts, you can also add any public wallet addresses to your
      Tenderly projects. This allows you to keep track of wallet activity, view
      all transactions, simulate transactions, set up wallet alerts, and more.


      Learn more about managing
      [Wallets](https://docs.tenderly.co/monitoring/wallets).
  - name: Simulations
    description: >-
      Transaction Simulations let you preview the exact outcomes of transactions
      before they are sent to the live network. Transactions are simulated on an
      exact replica of the latest state of the specific network, providing the
      most accurate simulation results. 


      The Tenderly API supports simulating single or bundled transactions
      through a single request. 


      **Common use cases for simulations**


      - [Asset and balance
      changes](https://docs.tenderly.co/simulations/asset-balance-changes): Get
      exact dollar values for all balance and asset changes that will happen.

      - [Gas estimation](https:/docs.tenderly.co//simulations/gas-estimation):
      Accurately predict the gas costs before sending the transaction.

      - [State overrides](https://docs.tenderly.co/simulations/state-overrides):
      Modify blockchain conditions like timestamps and contract data to test
      different scenarios.

      - [Preview transaction
      outcomes](https://docs.tenderly.co/simulations/transaction-preview):
      Identify and fix issues that could cause transactions to fail.

      - Access lists: Create lists of addresses and storage slots the
      transaction will access.

      - Human-readable errors: Get complex errors decoded into explanations that
      you can easily understand.


      Learn more about [Transaction
      Simulations](https://docs.tenderly.co/simulations).
  - name: Alerts
    description: >-
      Alerts listen for specific on-chain events and send real-time
      notifications to your desired destination when the event occurs. This can
      be email, your favorite messaging app, an incident monitoring system, or
      webhooks and Web3 Actions.


      Learn more about
      [Alerts](https://docs.tenderly.co/alerts/intro-to-alerts).
  - name: Delivery Channels
    description: >-
      When the desired event triggers your Alert, Tenderly will send the data
      about the event to a designated Alert Destination. The Destination
      (Delivery Channel) will use this data to send you an email notification,
      Discord, or Slack message or send it to another Tenderly system like Web3
      Actions or a Webhook.


      Learn more about [Delivery
      Channels](https://docs.tenderly.co/alerts/configuring-alert-destinations).
  - name: Web3 Actions
    description: >-
      Web3 Actions allow you to execute custom code in response to on-chain and
      off-chain events. They work as programmable hooks for smart contracts. A
      Web3 Action is a regular JS/TS function that is executed on our
      infrastructure. 


      Learn more about [Web3
      Actions](https://docs.tenderly.co/web3-actions/intro-to-web3-actions).
  - name: Virtual Environments
    description: >-
      Virtual Environments are simulated blockchain networks, designed to
      replicate real networks for various stages of dapp development. Use them
      as risk-free development and staging infrastructure that fully tracks real
      network state without the need to use real cryptocurrency or assets.


      Learn more about [Virtual
      Environments](https://docs.tenderly.co/virtual-testnets).
  - name: Environments
    description: >-
      Environments are multi-chain groupings of Virtual Environments, providing
      a coordinated set of simulated networks for end-to-end cross-chain
      testing. Each environment contains a Virtual Environment per configured
      network, and an active instance manages the current state across all
      chains.


      Environments support cross-chain bridge simulation, allowing you to test
      bridging and messaging protocols across networks in a fully isolated and
      reproducible setup.
  - name: Other
    description: >-
      This section contains miscellaneous endpoints that do not fit into other
      categories, such as checking supported networks on the Tenderly platform.
paths:
  /v1/account/{accountSlug}/project/{projectSlug}/simulate-bundle:
    post:
      tags:
        - Simulations
      summary: Simulate bundled transactions
      description: >-
        Call the `simulate-bundle` endpoint to simulate multiple consecutive
        transactions at once. You can simulate bundled transactions on real-time
        data from over [105+ supported
        networks](https://docs.tenderly.co/supported-networks-and-languages).
        This endpoint receive an array of transactions that get simulated one
        after another on the same block.


        **Note:** If the initial transaction in the array changes the state, all
        subsequent transactions will be simulated against this modified state.
        Furthermore, should a simulation fail for any reason, all following
        simulations in the sequence will not be executed.


        Learn more about [bundled
        simulations](https://docs.tenderly.co/simulations/bundled-simulations).


        The response returns a `simulation_results` array, where each element
        corresponds to a simulation in the input array (in the same order). Each
        result contains the following objects:


        `transaction`: Contains data related to the simulated transaction,
        including its hash, block number, origin and destination addresses, gas
        details, input data, nonce, and other transaction details, like the
        status, timestamp, and involved contract addresses. The nested
        `transaction_info` object holds detailed execution data such as the call
        trace, emitted logs, state diffs, and asset changes.


        `simulation`: Contains metadata about this simulation within the bundle,
        including its unique ID, project and owner IDs, block number, gas used,
        the method invoked, simulation status, state overrides applied, and
        other metadata.


        `contracts`: Contains data about the contract(s) involved in the
        transaction, including the contract's ID, network ID, balance,
        verification status, associated standards (like ERC20), token-specific
        data if the contract is a token, compiler version, and even the source
        code of the contract in some cases.


        `generated_access_list`: Contains a list of addresses and storage keys
        that the transaction will access, enabling certain gas cost
        optimizations. The access list is a feature introduced in [Ethereum's
        EIP-2930](https://eips.ethereum.org/EIPS/eip-2930).
      operationId: simulateTransactionBundle
      parameters:
        - name: accountSlug
          in: path
          schema:
            type: string
          required: true
          description: Account slug of the user
          example: me
        - name: projectSlug
          in: path
          schema:
            type: string
          required: true
          description: Project slug of the account
          example: project
      requestBody:
        required: true
        description: Simulate transaction bundle payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/simulation-bundle-payload'
            examples:
              dai_mint_approve_transfer:
                $ref: '#/components/examples/bundle_dai_mint_approve_transfer_request'
              approve_permit2_swap:
                $ref: '#/components/examples/bundle_approve_permit2_swap_request'
      responses:
        '200':
          $ref: '#/components/responses/simulate_bundle_post'
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '500':
          $ref: '#/components/responses/server_error'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import axios from 'axios';

            import * as dotenv from 'dotenv';

            import { ethers } from 'ethers';


            dotenv.config();


            // assuming environment variables TENDERLY_ACCOUNT_SLUG,
            TENDERLY_PROJECT_SLUG and TENDERLY_ACCESS_KEY are set

            // https://docs.tenderly.co/account/projects/account-project-slug

            //
            https://docs.tenderly.co/account/projects/how-to-generate-api-access-token

            const { TENDERLY_ACCOUNT_SLUG, TENDERLY_PROJECT_SLUG,
            TENDERLY_ACCESS_KEY } = process.env;


            const batchedSimulations = async () => {
              console.time('Batch Simulation');

              const daiSequence = (
                await axios.post(
                  `https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate-bundle`,
                  // the transaction
                  {
                    simulations: getTxSequence().map((transaction) => ({
                      network_id: '1', // network to simulate on
                      save: true,
                      save_if_fails: true,
                      simulation_type: 'full',
                      ...transaction,
                    })),
                  },
                  {
                    headers: {
                      'X-Access-Key': TENDERLY_ACCESS_KEY as string,
                    },
                  },
                )
              ).data;
              console.timeEnd('Batch Simulation');
              console.log(JSON.stringify(daiSequence, null, 2));
            };


            function getTxSequence() {
              const fakeWardAddress = '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2';
              const daiOwner = 'e58b9ee93700a616b50509c8292977fa7a0f8ce1';
              const daiSpend = 'f7ddedc66b1d482e5c38e4730b3357d32411e5dd';
              const daiRecip = 'e58b9ee93700a616b50509c8292977fa7a0f8ce1';
              const daiContract = '0x6b175474e89094c44da98b954eedeac495271d0f';
              return [
                // TX1: Mint 2 DAI for e58b9ee93700a616b50509c8292977fa7a0f8ce1.
                // Must do state override so sender (from) is considered a ward for this simulation
                {
                  from: fakeWardAddress,
                  to: '0x6b175474e89094c44da98b954eedeac495271d0f',
                  input:
                    '0x40c10f19000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce10000000000000000000000000000000000000000000000001bc16d674ec80000',
                  // make 0xcace477c66b1f2e151974eeada9ac8b95a31c50593ae1db2f048f0a2b54c1424 a ward
                  state_objects: {
                    '0x6b175474e89094c44da98b954eedeac495271d0f': {
                      storage: {
                        '0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03':
                          '0x0000000000000000000000000000000000000000000000000000000000000001',
                      },
                    },
                  },
                },
                // TX2: e58b9ee93700a616b50509c8292977fa7a0f8ce1 approves 1 DAI to f7ddedc66b1d482e5c38e4730b3357d32411e5dd
                {
                  from: '0xe58b9ee93700a616b50509c8292977fa7a0f8ce1',
                  to: '0x6b175474e89094c44da98b954eedeac495271d0f',
                  input:
                    '0x095ea7b3000000000000000000000000f7ddedc66b1d482e5c38e4730b3357d32411e5dd0000000000000000000000000000000000000000000000000de0b6b3a7640000',
                },
                {
                  // TX3: 0xf7ddedc66b1d482e5c38e4730b3357d32411e5dd calls transferFrom to transfer 0.5 DAI belonging to e58b9ee93700a616b50509c8292977fa7a0f8ce1, sending them to e58b9ee93700a616b50509c8292977fa7a0f8ce1
                  from: '0xf7ddedc66b1d482e5c38e4730b3357d32411e5dd',
                  to: '0x6b175474e89094c44da98b954eedeac495271d0f',
                  input:
                    '0x23b872dd000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce1000000000000000000000000bd8daa414fda8a8a129f7035e7496759c5af8570000000000000000000000000000000000000000000000000006a94d74f430000',
                },
              ];
            }


            function getWardStorageLocation(wardAddress: string) {
              // calculate the storage location of `wards[wardAddress]`
              // yields 0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03
              return ethers.utils.keccak256(
                ethers.utils.concat([
                  ethers.utils.hexZeroPad(wardAddress, 32), // the ward address (address 0x000..0) - mapping key
                  ethers.utils.hexZeroPad('0x0', 32), // the wards slot is 0th in the DAI contract - the mapping variable
                ]),
              );
            }


            batchedSimulations();
components:
  schemas:
    simulation-bundle-payload:
      type: object
      properties:
        simulations:
          title: simulations
          description: >-
            Array of transactions to simulate sequentially. Each subsequent
            transaction sees

            the state changes from all previous transactions. If a simulation
            fails, all

            following simulations in the sequence will not be executed.
          type: array
          items:
            $ref: '#/components/schemas/simulation-payload'
        block_number:
          title: block_number
          description: >-
            Block number to use for all simulations in the bundle. Individual
            simulations can override this.
          type: number
        simulation_type:
          title: simulation_type
          description: >-
            Default simulation type for all simulations in the bundle.
            Individual simulations can override this.
          type: string
          enum:
            - full
            - quick
            - abi
        state_objects:
          $ref: '#/components/schemas/state-override'
          title: state_objects
          description: >-
            Initial state overrides applied before the first simulation. The
            **key** is the

            contract address, and the **value** is an object that contains
            overrides of nonce,

            code, balance, or storage.
          type: object
        save:
          title: save
          description: Save all simulations in the bundle to the dashboard.
          type: boolean
      required:
        - simulations
    simulation-payload:
      type: object
      properties:
        network_id:
          title: network_id
          description: ID of the network on which the simulation is being run.
          type: string
          example: '1'
        from:
          title: from
          description: Address initiating the transaction.
          type: string
          example: '0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df'
        to:
          title: to
          description: The recipient address of the transaction.
          type: string
          example: '0xdef171fe48cf0115b1d80b88dc8eab59176fee57'
        input:
          title: input
          description: Encoded contract method call data.
          type: string
          example: >-
            0xa94e78ef000000000000000000000000000000000000000000000000000000000000002000000000000000000000000068037790a0229e9ce6eaa8a99ea92964106c470300000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000145dc1b2e00000000000000000000000000000000000000000000000000000001477f4d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000007800000000000000000000000000000000000000000000000000000000064d281e65c9438a5a99c4bccb1035296d5d2d8d200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000320000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a73000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002b68037790a0229e9ce6eaa8a99ea92964106c47030001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009be264469ef954c139da4a45cf76cbcc5e3a6a730000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000060000000000000000000000001b81d678ffb9c0263b24a97847620c99d213eb14000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000064db6806000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        gas:
          title: gas
          description: Amount of gas provided for the simulation.
          type: number
          example: 648318
        block_number:
          title: block_number
          description: Number of the block to be used for the simulation.
          type: number
          example: 17884583
        transaction_index:
          title: transaction_index
          description: Index of the transaction within the block.
          type: number
          example: 0
        gas_price:
          title: gas_price
          description: >-
            String representation of a number that represents price of the gas
            in Wei.
          type: string
          example: '18312000018'
        max_fee_per_gas:
          title: max_fee_per_gas
          description: >-
            Maximum fee per gas for EIP-1559 transactions. String representation
            of a number in Wei.
          type: string
          example: '20000000000'
        max_priority_fee_per_gas:
          title: max_priority_fee_per_gas
          description: >-
            Maximum priority fee (tip) per gas for EIP-1559 transactions. String
            representation of a number in Wei.
          type: string
          example: '1000000000'
        nonce:
          title: nonce
          description: >-
            Transaction nonce override. If not specified, the nonce is
            automatically determined from the sender's current state.
          type: number
          example: 0
        estimate_gas:
          title: estimate_gas
          description: Flag that enables precise gas estimation.
          type: boolean
          example: false
        value:
          title: value
          description: Amount of Ether (in Wei) sent along with the transaction.
          type: string
          example: '0'
        generate_access_list:
          title: generate_access_list
          description: Flag that enables returning the access list in a response.
          type: boolean
          example: false
        access_list:
          title: access_list
          description: >-
            List of addresses with their storage keys to grant access for this
            transaction.
          type: array
          items: {}
          example:
            - address: '0x3f41a1cfd3c8b8d9c162de0f42307a0095a6e5df'
              storage_keys: []
        save:
          title: save
          description: Flag indicating whether to save the simulation in dashboard UI.
          type: boolean
          example: true
        save_if_fails:
          title: save_if_fails
          description: Flag indicating whether to save failed simulation in dashboard UI.
          type: boolean
          example: true
        simulation_type:
          title: simulation_type
          description: Opt for quick, abi, or full simulation API mode.
          type: string
          enum:
            - full
            - quick
            - abi
          example: full
        block_header:
          title: block_header
          description: Overrides for specific block header.
          type: object
          example:
            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:
          $ref: '#/components/schemas/state-override'
          title: state_objects
          description: >-
            Overrides for a given contract. In this mapping, the **key** is the
            contract address, and the **value** is an object that contains
            overrides of nonce, code, balance, or state.
          type: object
          example:
            '0xdac17f958d2ee523a2206206994597c13d831ec7':
              storage:
                '0x0000000000000000000000000000000000000000000000000000000000000000': >-
                  0x000000000000000000000000c6cde7c39eb2f0f0095f41570af89efc2c1ea828
        l1_block_number:
          title: l1_block_number
          description: >-
            The latest L1 block number known to L2. It applies for the Optimism
            transactions.
          type: number
          example: 100004000
        l1_timestamp:
          title: l1_timestamp
          description: >-
            The timestamp of the latest L1 block. It applies for the Optimism
            transactions.
          type: number
          example: 1686124292
        l1_message_sender:
          title: l1_message_sender
          description: >-
            The address of the sender of the latest message from L1 to L2. It
            applies for the Optimism transactions.
          type: string
          example: '0x0000000000000000000000000000000000000000'
        deposit_tx:
          title: deposit_tx
          description: >-
            Indicates if the transaction is a deposit from L1 to L2. It applies
            for the Optimism Bedrock transactions.
          type: boolean
          example: false
        system_tx:
          title: system_tx
          description: >-
            Indicates if the transaction is a system-level operation within L2.
            It applies for the Optimism Bedrock transactions.
          type: boolean
          example: false
        mint:
          title: mint
          description: >-
            The amount of a specific token minted within L2. It applies for the
            Optimism Bedrock transactions.
          type: number
          example: 0
        amount_to_mint:
          title: amount_to_mint
          description: >-
            The desired amount to be minted in the next operation. It applies
            for the Optimism Bedrock transactions.
          type: string
          example: '0'
      required:
        - network_id
        - from
        - to
        - input
    state-override:
      type: object
      additionalProperties:
        type: object
        properties:
          nonce:
            type: integer
            format: int64
          code:
            type: string
            format: bytes
            description: >-
              Bytecode that will override the **code** associated to the given
              account.
          balance:
            anyOf:
              - type: string
                description: Balance in hex format (e.g. "0x113b9aca01").
                example: '0x113b9aca01'
              - type: integer
                description: Balance as decimal number.
                example: 1.0000001e+25
          storage:
            type: object
            description: >-
              Overrides of storage slots. In this mapping, the **key** is the
              variable storage slot, and the **value** contains the override.
            additionalProperties:
              type: string
    simulation-bundle-response:
      description: >-
        Bundle simulation response containing an array of simulation results,
        one per input simulation.

        Order matches the input simulations array. Each result reflects the
        cumulative state from previous simulations.
      type: object
      properties:
        simulation_results:
          title: simulation_results
          description: >-
            Array of simulation results, one per input simulation. Order matches
            the input

            simulations array. Each result reflects the cumulative state changes
            from all

            previous simulations in the bundle.
          type: array
          items:
            type: object
            properties:
              transaction:
                title: transaction
                description: >-
                  Contains data related to the simulated transaction, including
                  its hash, block number,

                  origin and destination addresses, gas details, input data,
                  nonce, status, timestamp,

                  and involved contract addresses. The nested `transaction_info`
                  object holds detailed

                  execution data such as the call trace, emitted logs, state
                  diffs, and asset changes.
                type: object
                properties:
                  hash:
                    title: hash
                    description: Transaction hash.
                    type: string
                    example: >-
                      0x3f95cbe58730449c3d7e284e607becd52363708c582d0c37e789e54c014d2065
                  block_hash:
                    title: block_hash
                    description: Hash of the block containing this transaction.
                    type: string
                  block_number:
                    title: block_number
                    description: Block number at which the transaction was simulated.
                    type: number
                    example: 22996361
                  from:
                    title: from
                    description: Address that initiated the transaction.
                    type: string
                    example: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2'
                  gas:
                    title: gas
                    description: Gas limit provided for the simulation.
                    type: number
                  gas_price:
                    title: gas_price
                    description: Gas price used in the simulation.
                    type: number
                    example: 0
                  gas_fee_cap:
                    title: gas_fee_cap
                    description: EIP-1559 max fee per gas.
                    type: number
                    example: 0
                  gas_tip_cap:
                    title: gas_tip_cap
                    description: EIP-1559 max priority fee per gas (tip).
                    type: number
                    example: 0
                  cumulative_gas_used:
                    title: cumulative_gas_used
                    description: >-
                      Total gas used in the block up to and including this
                      transaction.
                    type: number
                    example: 0
                  gas_used:
                    title: gas_used
                    description: Actual gas consumed by the simulation.
                    type: number
                    example: 53465
                  effective_gas_price:
                    title: effective_gas_price
                    description: Effective gas price after EIP-1559 calculations.
                    type: number
                    example: 0
                  input:
                    title: input
                    description: Hex-encoded calldata sent with the transaction.
                    type: string
                  nonce:
                    title: nonce
                    description: Transaction nonce of the sender.
                    type: number
                    example: 0
                  to:
                    title: to
                    description: Recipient address of the transaction.
                    type: string
                    example: '0x6b175474e89094c44da98b954eedeac495271d0f'
                  index:
                    title: index
                    description: Transaction index within the block.
                    type: number
                    example: 0
                  value:
                    title: value
                    description: Ether value sent with the transaction (in hex).
                    type: string
                    example: 0x
                  access_list:
                    title: access_list
                    description: EIP-2930 access list used by the transaction.
                    type:
                      - array
                      - 'null'
                    items: {}
                  status:
                    title: status
                    description: >-
                      Whether the transaction succeeded (true) or reverted
                      (false).
                    type: boolean
                    example: true
                  addresses:
                    title: addresses
                    description: List of addresses involved in the transaction.
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                  contract_ids:
                    title: contract_ids
                    description: >-
                      List of contract identifiers in `network:chainId:address`
                      format.
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                  network_id:
                    title: network_id
                    description: Network ID on which the simulation was run.
                    type: string
                    example: '1'
                  timestamp:
                    title: timestamp
                    description: Timestamp of the block used for simulation.
                    type: string
                    format: date-time
                    example: '2025-07-25T13:08:45Z'
                  function_selector:
                    title: function_selector
                    description: 4-byte function selector of the called method.
                    type: string
                  l1_block_number:
                    title: l1_block_number
                    description: L1 block number (for L2 transactions).
                    type: number
                    example: 0
                  l1_timestamp:
                    title: l1_timestamp
                    description: L1 timestamp (for L2 transactions).
                    type: number
                    example: 0
                  deposit_tx:
                    title: deposit_tx
                    description: Whether this is a deposit transaction (L1 to L2).
                    type: boolean
                    example: false
                  system_tx:
                    title: system_tx
                    description: Whether this is a system transaction.
                    type: boolean
                    example: false
                  sig:
                    title: sig
                    description: Transaction signature values.
                    type: object
                    properties:
                      v:
                        type: string
                      r:
                        type: string
                      s:
                        type: string
                  transaction_info:
                    title: transaction_info
                    description: >-
                      Detailed execution information including the call trace,
                      decoded method parameters,

                      emitted logs, state diffs, asset changes, and balance
                      changes.
                    type: object
                    properties:
                      contract_id:
                        title: contract_id
                        description: Identifier of the primary contract in the transaction.
                        type: string
                        example: eth:1:0x6b175474e89094c44da98b954eedeac495271d0f
                      block_number:
                        title: block_number
                        description: Block number of the simulation.
                        type: number
                      transaction_id:
                        title: transaction_id
                        description: Transaction hash (same as top-level hash).
                        type: string
                      contract_address:
                        title: contract_address
                        description: Address of the primary contract called.
                        type: string
                      method:
                        title: method
                        description: >-
                          Name of the method that was called (e.g., "mint",
                          "approve", "transferFrom").
                        type:
                          - string
                          - 'null'
                      parameters:
                        title: parameters
                        description: Decoded input parameters of the called method.
                        type:
                          - array
                          - 'null'
                        items: {}
                      intrinsic_gas:
                        title: intrinsic_gas
                        description: Intrinsic gas cost of the transaction.
                        type: number
                      refund_gas:
                        title: refund_gas
                        description: Gas refunded after execution.
                        type: number
                      call_trace:
                        title: call_trace
                        description: >-
                          Root of the call trace tree. Contains the top-level
                          call and all nested

                          internal calls, including decoded inputs/outputs, gas
                          usage, and errors.
                        type: object
                      stack_trace:
                        title: stack_trace
                        description: Stack trace of the error if the transaction reverted.
                        type:
                          - array
                          - 'null'
                        items: {}
                      logs:
                        title: logs
                        description: Decoded event logs emitted during execution.
                        type: array
                        items: {}
                      balance_diff:
                        title: balance_diff
                        description: >-
                          Balance changes for addresses involved in the
                          transaction.

                          Each entry shows the original and dirty (modified)
                          balance.
                        type: array
                        items:
                          type: object
                          properties:
                            address:
                              type: string
                            original:
                              type: string
                            dirty:
                              type: string
                            is_miner:
                              type: boolean
                      nonce_diff:
                        title: nonce_diff
                        description: >-
                          Nonce changes for addresses involved in the
                          transaction.

                          Each entry shows the original and dirty (incremented)
                          nonce.
                        type: array
                        items:
                          type: object
                          properties:
                            address:
                              type: string
                            original:
                              type: string
                            dirty:
                              type: string
                      state_diff:
                        title: state_diff
                        description: >-
                          State changes caused by the transaction. Each entry
                          shows the address,

                          storage slot key, and the original vs dirty values.
                        type: array
                        items: {}
                      raw_state_diff:
                        title: raw_state_diff
                        description: >-
                          Raw (non-decoded) state changes as storage slot
                          key-value pairs.
                        type:
                          - array
                          - 'null'
                        items: {}
                      console_logs:
                        title: console_logs
                        description: >-
                          Console log outputs from Hardhat-style console.log
                          calls.
                        type:
                          - array
                          - 'null'
                        items: {}
                      created_at:
                        title: created_at
                        description: Timestamp when the simulation was created.
                        type: string
                        format: date-time
                      asset_changes:
                        title: asset_changes
                        description: >-
                          Token transfers that occurred during the transaction,
                          including ERC20,

                          ERC721, ERC1155, and native currency movements. Each
                          entry includes

                          token info, transfer type (Transfer, Mint, Burn),
                          amounts, and USD values.
                        type:
                          - array
                          - 'null'
                        items: {}
                      balance_changes:
                        title: balance_changes
                        description: >-
                          Net balance changes per address, aggregating all asset
                          transfers

                          for each participant in the transaction.
                        type:
                          - array
                          - 'null'
                        items: {}
                      exposure_changes:
                        title: exposure_changes
                        description: >-
                          Token approval changes (Approve, Revoke, Permit,
                          ApproveForAll, RevokeForAll)

                          that occurred during the transaction.
                        type:
                          - array
                          - 'null'
                        items: {}
                  error_message:
                    title: error_message
                    description: Error message if the transaction reverted.
                    type: string
                  method:
                    title: method
                    description: Name of the method called.
                    type: string
                  decoded_input:
                    title: decoded_input
                    description: Decoded input parameters at the top level.
                    type:
                      - array
                      - 'null'
                    items: {}
                  call_trace:
                    title: call_trace
                    description: >-
                      Flat call trace entries (simplified view of internal
                      calls).
                    type:
                      - array
                      - 'null'
                    items:
                      type: object
                      properties:
                        call_type:
                          type: string
                        from:
                          type: string
                        to:
                          type: string
                        gas:
                          type: number
                        gas_used:
                          type: number
                        input:
                          type: string
                        output:
                          type: string
                        error:
                          type: string
              simulation:
                title: simulation
                description: >-
                  Contains metadata about this simulation within the bundle,
                  including its unique ID,

                  project and owner IDs, block number, gas used, the method
                  invoked, simulation status,

                  block header used, and timestamps.
                type: object
                properties:
                  id:
                    title: id
                    description: Unique identifier of the simulation.
                    type: string
                    format: uuid
                  project_id:
                    title: project_id
                    description: ID of the project the simulation belongs to.
                    type: string
                    format: uuid
                  owner_id:
                    title: owner_id
                    description: ID of the account that owns the simulation.
                    type: string
                    format: uuid
                  network_id:
                    title: network_id
                    description: Network ID on which the simulation was run.
                    type: string
                    example: '1'
                  block_number:
                    title: block_number
                    description: Block number used for the simulation.
                    type: number
                  transaction_index:
                    title: transaction_index
                    description: Transaction index within the block.
                    type: number
                    example: 0
                  from:
                    title: from
                    description: Sender address.
                    type: string
                  to:
                    title: to
                    description: Recipient address.
                    type: string
                  input:
                    title: input
                    description: Hex-encoded calldata.
                    type: string
                  gas:
                    title: gas
                    description: Gas limit.
                    type: number
                  gas_price:
                    title: gas_price
                    description: Gas price used.
                    type: string
                    example: '0'
                  gas_used:
                    title: gas_used
                    description: Actual gas consumed.
                    type: number
                  value:
                    title: value
                    description: Ether value sent.
                    type: string
                    example: '0'
                  method:
                    title: method
                    description: Name of the called method.
                    type: string
                  status:
                    title: status
                    description: Whether the simulation succeeded.
                    type: boolean
                    example: true
                  access_list:
                    title: access_list
                    description: EIP-2930 access list.
                    type:
                      - array
                      - 'null'
                    items: {}
                  queue_origin:
                    title: queue_origin
                    description: Origin of the transaction in queue (for L2).
                    type: string
                  block_header:
                    title: block_header
                    description: Block header used during the simulation.
                    type: object
                  state_overrides:
                    title: state_overrides
                    description: State overrides that were applied for this simulation.
                    type:
                      - object
                      - 'null'
                  deposit_tx:
                    title: deposit_tx
                    description: Whether this is a deposit transaction.
                    type: boolean
                    example: false
                  system_tx:
                    title: system_tx
                    description: Whether this is a system transaction.
                    type: boolean
                    example: false
                  nonce:
                    title: nonce
                    description: Nonce of the sender.
                    type: number
                  addresses:
                    title: addresses
                    description: Addresses involved in the simulation.
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                  contract_ids:
                    title: contract_ids
                    description: Contract identifiers involved.
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                  shared:
                    title: shared
                    description: Whether the simulation is shared/public.
                    type: boolean
                    example: false
                  created_at:
                    title: created_at
                    description: Timestamp when the simulation was created.
                    type: string
                    format: date-time
              contracts:
                title: contracts
                description: >-
                  List of contract accounts involved in this simulation. Each
                  entry contains

                  the contract's ID, network ID, address, name, verification
                  status, associated

                  standards (ERC20, ERC721, etc.), token data, compiler version,
                  deployed bytecode,

                  ABI, and source code (if verified). The level of detail
                  depends on the simulation_type:

                  `quick` returns minimal contract info, `abi` includes ABI
                  data, and `full` includes

                  complete source and trace information.
                type: array
                items:
                  type: object
                  properties:
                    id:
                      title: id
                      description: >-
                        Unique contract identifier in `network:chainId:address`
                        format.
                      type: string
                      example: eth:1:0x6b175474e89094c44da98b954eedeac495271d0f
                    contract_id:
                      title: contract_id
                      description: Contract identifier (same as id).
                      type: string
                    balance:
                      title: balance
                      description: Contract balance.
                      type: string
                    network_id:
                      title: network_id
                      description: Network ID the contract is deployed on.
                      type: string
                      example: '1'
                    public:
                      title: public
                      description: Whether the contract is publicly verified.
                      type: boolean
                    verified_by:
                      title: verified_by
                      description: Source of verification (e.g., "etherscan").
                      type: string
                    verification_date:
                      title: verification_date
                      description: When the contract was verified.
                      type: string
                      format: date-time
                    address:
                      title: address
                      description: Contract address.
                      type: string
                    contract_name:
                      title: contract_name
                      description: Name of the contract (e.g., "Dai").
                      type: string
                      example: Dai
                    ens_domain:
                      title: ens_domain
                      description: ENS domains associated with this address.
                      type:
                        - array
                        - 'null'
                      items:
                        type: string
                    type:
                      title: type
                      description: |-
                        Account type. Possible values:
                        - `wallet` - Externally Owned Account (EOA)
                        - `contract` - Verified smart contract
                        - `unverified_contract` - Unverified smart contract
                      type: string
                      enum:
                        - wallet
                        - contract
                        - unverified_contract
                    standard:
                      title: standard
                      description: >-
                        Primary contract standard. Possible values include:

                        `erc20`, `erc721`, `erc1155`, `eip1167`, `eip1967`,
                        `beacon_proxy`, `custom_proxy`, `native_currency`
                      type: string
                    standards:
                      title: standards
                      description: List of all standards the contract implements.
                      type: array
                      items:
                        type: string
                    token_data:
                      title: token_data
                      description: Token-specific data if the contract is a token.
                      type:
                        - object
                        - 'null'
                      properties:
                        symbol:
                          type: string
                        name:
                          type: string
                        decimals:
                          type: number
                        main:
                          type: boolean
                    evm_version:
                      title: evm_version
                      description: EVM version the contract was compiled for.
                      type: string
                    compiler_version:
                      title: compiler_version
                      description: Compiler version used to compile the contract.
                      type: string
                    optimizations_used:
                      title: optimizations_used
                      description: Whether compiler optimizations were enabled.
                      type: boolean
                    optimization_runs:
                      title: optimization_runs
                      description: Number of optimizer runs.
                      type: number
                    libraries:
                      title: libraries
                      description: Libraries linked to the contract.
                      type:
                        - object
                        - 'null'
                    compiler_settings:
                      title: compiler_settings
                      description: Compiler settings used for compilation.
                      type: object
                    deployed_bytecode:
                      title: deployed_bytecode
                      description: Hex-encoded deployed bytecode of the contract.
                      type: string
                    creation_bytecode:
                      title: creation_bytecode
                      description: Hex-encoded creation bytecode of the contract.
                      type: string
                    data:
                      title: data
                      description: >-
                        Public contract data including the main contract name,
                        source files, and ABI.
                      type:
                        - object
                        - 'null'
                      properties:
                        main_contract:
                          type: number
                        contract_info:
                          type:
                            - array
                            - 'null'
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                              path:
                                type: string
                              name:
                                type: string
                              source:
                                type: string
                        abi:
                          type: array
                          items: {}
                        raw_abi:
                          description: Raw ABI data.
                    src_map:
                      title: src_map
                      description: Source map for the contract bytecode.
                      type:
                        - string
                        - 'null'
                    creation_block:
                      title: creation_block
                      description: Block number at which the contract was deployed.
                      type: number
                    creation_tx:
                      title: creation_tx
                      description: Transaction hash of the contract deployment.
                      type: string
                    creator_address:
                      title: creator_address
                      description: Address that deployed the contract.
                      type: string
                    language:
                      title: language
                      description: Programming language (solidity or vyper).
                      type: string
                      enum:
                        - solidity
                        - vyper
                    in_project:
                      title: in_project
                      description: Whether the contract is part of the project.
                      type: boolean
              generated_access_list:
                title: generated_access_list
                description: >-
                  EIP-2930 access list generated for this simulation when
                  `generate_access_list`

                  is set to `true` in the request. Contains addresses and their
                  accessed storage

                  keys for gas optimization.
                type: array
                items:
                  type: object
                  properties:
                    address:
                      title: address
                      description: Contract address in the access list.
                      type: string
                    storage_keys:
                      title: storage_keys
                      description: Storage keys accessed in this contract.
                      type: array
                      items:
                        type: string
      required:
        - simulation_results
    error:
      type: object
      properties:
        error:
          type: object
          properties:
            id:
              description: >-
                Endpoints include an error ID that should be  provided when
                reporting bugs or opening support tickets to help  identify the
                issue.
              type: string
              example: 4d9d8375-3c56-4925-a3e7-eb137fed17e9
            slug:
              description: >-
                A short identifier corresponding to the HTTP status code
                returned. For  example, the ID for a response returning a 404
                status code would be "not_found."
              type: string
              example: not_found
            message:
              description: >-
                A message providing additional information about the error,
                including  details to help resolve it when possible.
              type: string
              example: The resource you were accessing could not be found.
            data:
              description: Additional context about the error.
              type: object
              properties:
                rid:
                  description: >-
                    Resource identifier indicating which resource type caused
                    the error.
                  type: string
                  enum:
                    - rid:account
                    - rid:project
                    - rid:alert
                    - rid:contract
                    - rid:delivery_channel
                    - rid:network
                    - rid:simulation
                    - rid:vnet
                    - rid:wallet
                    - rid:action
                    - rid:action_call
                  example: rid:project
              additionalProperties: true
          required:
            - id
            - slug
            - message
      required:
        - error
  examples:
    bundle_dai_mint_approve_transfer_request:
      summary: DAI Mint, Approve & TransferFrom with State Override
      description: >-
        A three-transaction bundle that simulates a DAI Mint → Approve →
        TransferFrom sequence.

        The first transaction uses a state override to make the sender a ward
        (authorized minter)

        on the DAI contract. Each subsequent transaction sees the state changes
        from the previous ones.
      value:
        simulations:
          - network_id: '1'
            save: true
            save_if_fails: true
            simulation_type: full
            from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2'
            to: '0x6b175474e89094c44da98b954eedeac495271d0f'
            input: >-
              0x40c10f19000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce10000000000000000000000000000000000000000000000001bc16d674ec80000
            state_objects:
              '0x6b175474e89094c44da98b954eedeac495271d0f':
                storage:
                  '0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03': >-
                    0x0000000000000000000000000000000000000000000000000000000000000001
          - network_id: '1'
            save: true
            save_if_fails: true
            simulation_type: full
            from: '0xe58b9ee93700a616b50509c8292977fa7a0f8ce1'
            to: '0x6b175474e89094c44da98b954eedeac495271d0f'
            input: >-
              0x095ea7b3000000000000000000000000f7ddedc66b1d482e5c38e4730b3357d32411e5dd0000000000000000000000000000000000000000000000000de0b6b3a7640000
          - network_id: '1'
            save: true
            save_if_fails: true
            simulation_type: full
            from: '0xf7ddedc66b1d482e5c38e4730b3357d32411e5dd'
            to: '0x6b175474e89094c44da98b954eedeac495271d0f'
            input: >-
              0x23b872dd000000000000000000000000e58b9ee93700a616b50509c8292977fa7a0f8ce1000000000000000000000000bd8daa414fda8a8a129f7035e7496759c5af8570000000000000000000000000000000000000000000000000006a94d74f430000
    bundle_approve_permit2_swap_request:
      summary: Approve, Permit2 & Swap
      description: >-
        A three-transaction bundle that simulates a token Approve → Permit2
        Allowance → Swap sequence.

        The first transaction approves the Permit2 contract to spend tokens. The
        second transaction

        grants a Permit2 allowance to the swap router. The third transaction
        executes a token swap

        through a Universal Router. Uses `estimate_gas` and `quick` simulation
        mode.
      value:
        simulations:
          - network_id: '1'
            estimate_gas: true
            simulation_type: quick
            save_if_fails: false
            from: '0xCdB122820fBd2e0EB4e8a553247630AC27471d31'
            to: '0x74b7F16337b8972027F6196A17a631aC6dE26d22'
            input: >-
              0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
            value: '0'
          - network_id: '1'
            estimate_gas: true
            simulation_type: quick
            save_if_fails: false
            from: '0xCdB122820fBd2e0EB4e8a553247630AC27471d31'
            to: '0x000000000022D473030F116dDEE9F6B43aC78BA3'
            input: >-
              0x87517c4500000000000000000000000074b7f16337b8972027f6196a17a631ac6de26d220000000000000000000000005507749f2c558bb3e162c6e90c314c092e7372ff000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000006a3e6fc1
            value: '0'
          - network_id: '1'
            estimate_gas: true
            simulation_type: quick
            save_if_fails: false
            from: '0xCdB122820fBd2e0EB4e8a553247630AC27471d31'
            to: '0x5507749f2c558bb3e162c6e90c314c092e7372ff'
            input: >-
              0x24856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000308000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000b71b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000074b7f16337b8972027f6196a17a631ac6de26d22000000000000000000000000e538905cf8410324e03a5a23c1c177a474d59b2b00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000040d990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002b74b7f16337b8972027f6196a17a631ac6de26d220001f4e538905cf8410324e03a5a23c1c177a474d59b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000cdb122820fbd2e0eb4e8a553247630ac27471d3100000000000000000000000000000000000000000000000000dfbcf8b5747196
            value: '0'
  responses:
    simulate_bundle_post:
      description: A successful response.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/simulation-bundle-response'
            oneOf:
              - $ref: '#/components/schemas/simulate_bundle_post_response'
    bad_request:
      description: Bad Request
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: bad_request
              message: Bad request input parameters
    unauthorized:
      description: Unauthorized
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: unauthorized
              message: Unauthorized
    forbidden:
      description: Forbidden
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: insufficient_permissions
              message: Insufficient permissions
    not_found:
      description: The resource was not found.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: resource_not_found
              message: The resource you requested could not be found.
    server_error:
      description: Server error.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: internal_server_error
              message: Internal server error
  headers:
    ratelimit-limit:
      schema:
        type: integer
      example: 100
      description: >-
        The default limit on number of requests that can be made per minute.
        Current rate limits are:

        * **Non-authenticated users:** 100 requests per minute

        * **Authenticated users:** 400 requests per minute
    ratelimit-remaining:
      schema:
        type: integer
      example: 16
      description: >-
        The number of requests in your quota that remain before you hit your
        request limit.
    ratelimit-reset:
      schema:
        type: integer
      example: 1444931833
      description: >-
        The time when the oldest request will expire. The value is given in Unix
        epoch time.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-Access-Key
      in: header
      description: >-
        An API key is a token that a client provides when making API calls. Send
        it as the `X-Access-Key` request header on any endpoint:


        ```bash

        curl '<API_ENDPOINT>' \
          -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
          ...
        ```


        Learn how to generate API access tokens at [Tenderly
        Docs](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token).
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication (also called token authentication) is an HTTP
        authentication scheme that involves security tokens called bearer
        tokens.

        The bearer token is a cryptic string, usually generated by the server in
        response to a login request. The client must send this token in

        the Authorization header when making requests to protected resources:


        ```bash

        curl '<API_ENDPOINT>' \
          -H 'Authorization: Bearer <TENDERLY_TOKEN>' \
          ...
        ```


        **Note**: Bearer tokens cannot be revoked and expire after 30 days.

````