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

# debug_traceCall | Arc

> Arc API method that traces the execution of a call without creating a transaction on the blockchain. Chainstack Arc reference.

Arc API method that traces the execution of a call without creating a transaction on the blockchain. This is useful for debugging contract interactions before sending actual transactions.

## Parameters

* `callObject` — the call object:
  * `from` — (optional) sender address
  * `to` — recipient address
  * `gas` — (optional) gas limit
  * `gasPrice` — (optional) gas price
  * `value` — (optional) value to send
  * `data` — (optional) call data
* `blockParameter` — the block number (hex) or tag (`latest`, `earliest`, `pending`)
* `tracerConfig` — (optional) tracer configuration object:
  * `tracer` — tracer type (e.g., `callTracer`, `prestateTracer`)

## Response

* `result` — the trace result object, format depends on the tracer used

For the default tracer:

* `gas` — gas used
* `failed` — whether the call failed
* `returnValue` — return data
* `structLogs` — array of execution steps

## `debug_traceCall` code examples

The following example traces a `balanceOf` call on the USDC token:

```javascript ethers.js theme={"system"}
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

// USDC token address
const USDC = "0x3600000000000000000000000000000000000000";
const TARGET_ADDRESS = "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294";

// Encode balanceOf(address)
const iface = new ethers.Interface(["function balanceOf(address) view returns (uint256)"]);
const data = iface.encodeFunctionData("balanceOf", [TARGET_ADDRESS]);

const traceCall = async () => {
    // Using default tracer
    const trace = await provider.send("debug_traceCall", [
      {
        to: USDC,
        data: data
      },
      "latest",
      {}
    ]);

    console.log("Gas used:", trace.gas);
    console.log("Failed:", trace.failed);
    console.log("Return value:", trace.returnValue);
    console.log("Execution steps:", trace.structLogs.length);
  };

traceCall();
```

```python web3.py theme={"system"}
from web3 import Web3

node_url = "CHAINSTACK_NODE_URL"
web3 = Web3(Web3.HTTPProvider(node_url))

# USDC token address
USDC = "0x3600000000000000000000000000000000000000"
TARGET_ADDRESS = "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294"

# balanceOf(address) calldata
data = "0x70a08231000000000000000000000000" + TARGET_ADDRESS[2:].lower()

result = web3.provider.make_request("debug_traceCall", [
    {
        "to": USDC,
        "data": data
    },
    "latest",
    {}
])

trace = result['result']
print(f"Gas used: {trace['gas']}")
print(f"Failed: {trace['failed']}")
print(f"Return value: {trace['returnValue']}")
print(f"Execution steps: {len(trace['structLogs'])}")
```

```bash cURL theme={"system"}
curl -X POST "CHAINSTACK_NODE_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "debug_traceCall",
    "params": [
      {
        "to": "0x3600000000000000000000000000000000000000",
        "data": "0x70a082310000000000000000000000009729187d9e8bbefa8295f39f5634ca454dd9d294"
      },
      "latest",
      {}
    ],
    "id": 1
  }'
```


## OpenAPI

````yaml openapi/arc_node_api/debug_and_trace/debug_traceCall.json POST /
openapi: 3.0.0
info:
  title: Chainstack Node API
  version: 1.0.0
  description: This is an API for interacting with a Chainstack node.
servers:
  - url: https://arc-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e
security: []
paths:
  /:
    post:
      tags:
        - upload
      summary: debug_traceCall
      operationId: debug_traceCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: debug_traceCall
                params:
                  type: array
                  default:
                    - from: '0x05756f67f5f6f4d3c798749a3c28b050dcd9aa99'
                      to: '0x3600000000000000000000000000000000000000'
                      gas: '0xf4240'
                      data: >-
                        0x70a0823100000000000000000000000005756f67f5f6f4d3c798749a3c28b050dcd9aa99
                    - latest
                    - tracer: callTracer
      responses:
        '200':
          description: Returns the result of debug_traceCall.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    properties:
                      from:
                        type: string
                      gas:
                        type: string
                      gasUsed:
                        type: string
                      to:
                        type: string
                      input:
                        type: string
                      error:
                        type: string
                      value:
                        type: string
                      type:
                        type: string
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  from: '0x05756f67f5f6f4d3c798749a3c28b050dcd9aa99'
                  gas: '0xf4240'
                  gasUsed: '0x727c'
                  to: '0x3600000000000000000000000000000000000000'
                  input: >-
                    0x70a0823100000000000000000000000005756f67f5f6f4d3c798749a3c28b050dcd9aa99
                  output: >-
                    0x000000000000000000000000000000000000000000000000000000000197c37e
                  calls:
                    - from: '0x3600000000000000000000000000000000000000'
                      gas: '0xe974a'
                      gasUsed: '0x2a7'
                      to: '0xc6ad664ac6679f4ce74e10e91449c93ec1ae3ca6'
                      input: >-
                        0x70a0823100000000000000000000000005756f67f5f6f4d3c798749a3c28b050dcd9aa99
                      output: >-
                        0x000000000000000000000000000000000000000000000000000000000197c37e
                      value: '0x0'
                      type: DELEGATECALL
                  value: '0x0'
                  type: CALL

````