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

# debug_traceTransaction

Returns all traces of a given transaction.

This method will use `80` [Compute Units](https://docs.validationcloud.io/nodeapi/about/billing.md).

***

> [!NOTE]
>
> Traces need the state of the traced block, so World Chain Mainnet can trace the last 10,064 blocks, about 5.6 hours at World Chain's 2-second block time. Older blocks return JSON-RPC error `-32603` with a message that contains `insufficient changesets to revert to block`.

## **Parameters**

`transactionHash` - String - Required - The transaction hash to be traced.

`object` - Object - Required - The tracer object with the following fields:

* `tracer` - String - The type of tracer, options are: `callTracer` or `prestateTracer`.
  * `callTracer` - String - The callTracer keeps track of all call frames, including depth - calls, that are made during a transaction.
  * `prestateTracer` - String - The prestateTracer replays the transaction and tracks every part of state that occurred during the transaction.
* `tracerConfig` - Object (Optional) - The object to specify the configurations of the tracer.
  * `onlyTopCall` - Boolean - When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.
* `timeout` - String (Optional) - A string of decimal integers that overrides the JavaScript-based tracing calls default timeout of 5 seconds. Example: `10s` for 10 seconds.

## **Returns**

`result` - With `callTracer`, an object with the result of the trace, containing:

* `from` - The address the transaction is sent from.
* `gas` - The integer of the gas provided for the transaction execution.
* `gasUsed` - The integer of the gas used.
* `to` - The address the transaction is directed to.
* `input` - The data given at the time of input.
* `value` - The integer of the value sent with this transaction.
* `type` - The type of call.

With `prestateTracer`, the result is instead a map keyed by account address, holding the state the transaction touched (such as `balance`, `nonce`, `code` and `storage`).

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0x009dcf67cc6d08394d72ddff30c14b7012896c29",
    "gas": "0x96cfb",
    "gasUsed": "0x60fd6",
    "to": "0x0000000071727de22e5e9d8baf0edac6f37da032",
    "input": "0x765e827f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000009dcf67cc6d08394d72ddff30c14b70...",
    "calls": [
      {
        "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
        "gas": "0x148e8",
        "gasUsed": "0x65ea",
        "to": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
        "input": "0x19822f7c0000000000000000000000000000000000000000000000000000000000000060d6e226fa264ba5a15cb5e225de120b01776eb9359bda510a214c238d...",
        "output": "0x00006b12967b00006b129fdb0000000000000000000000000000000000000000",
        "calls": [
          {
            "from": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
            "gas": "0x13063",
            "gasUsed": "0x520c",
            "to": "0x29fcb43b46531bca003ddc8fcb67ffe91900c762",
            "input": "0x19822f7c0000000000000000000000000000000000000000000000000000000000000060d6e226fa264ba5a15cb5e225de120b01776eb9359bda510a214c238d...",
            "output": "0x00006b12967b00006b129fdb0000000000000000000000000000000000000000",
            "value": "0x0",
            "type": "DELEGATECALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      },
      {
        "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
        "gas": "0x7cc6f",
        "gasUsed": "0x4e5e4",
        "to": "0x0000000071727de22e5e9d8baf0edac6f37da032",
        "input": "0x0042dc530000000000000000000000000000000000000000000000000000000000000200000000000000000000000000a380ef7797fb48ddc63a085b815a7498...",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "calls": [
          {
            "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
            "gas": "0x6abce",
            "gasUsed": "0x4cedd",
            "to": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
            "input": "0x7bb3742800000000000000000000000038869bf66a61cf6bdb996a6ae40d5853fd43b52600000000000000000000000000000000000000000000000000000000...",
            "value": "0x0",
            "type": "CALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      }
    ],
    "value": "0x0",
    "type": "CALL"
  }
}
```

```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://mainnet.worldchain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x976ede826ce145939ff1d6ba66d01aa5c8e9aea7fba57db427949a4516f870ce",{"tracer":"callTracer"}],"id":1}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.