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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/tvm/tools/txtracer",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# TxTracer

export const Image = ({src, darkSrc, alt = '', darkAlt, href, target, height = 342, width = 608, noZoom = false, center = false}) => {
  const isSVG = src.match(/\.svg(?:[#?].*?)?$/i) !== null;
  const shouldInvert = isSVG && !darkSrc;
  const shouldCreateLink = href !== undefined;
  const minPx = 9;
  const maxPx = 608;
  const expectedPx = `a number or a string with a number that is greater than ${minPx - 1} and less than or equal to ${maxPx}`;
  const createInvalidPropCallout = (title, received, expected) => {
    return <Danger>
        <span className="font-bold">
          Invalid <code>{title.toString()}</code> passed!
        </span>
        <br />
        <span className="font-bold">Received: </span>
        {received.toString()}
        <br />
        <span className="font-bold">Expected: </span>
        {expected.toString()}
        {}
      </Danger>;
  };
  const checkValidDimensionValue = value => {
    switch (typeof value) {
      case "string":
      case "number":
        const num = Number(value);
        return Number.isSafeInteger(num) && num >= minPx && num <= maxPx;
      default:
        return false;
    }
  };
  let callouts = [];
  if (height && !checkValidDimensionValue(height)) {
    callouts.push(createInvalidPropCallout("height", height, expectedPx));
  }
  if (width && !checkValidDimensionValue(width)) {
    callouts.push(createInvalidPropCallout("width", width, expectedPx));
  }
  if (callouts.length !== 0) {
    return callouts;
  }
  const heightPx = Number(height);
  const widthPx = Number(width);
  const shouldCenter = center === "true" || center === true ? true : false;
  const shouldNotZoom = noZoom === "true" || noZoom === true ? true : false;
  const images = <>
      <img className="block dark:hidden" src={src} alt={alt} {...height && ({
    height: heightPx
  })} {...width && ({
    width: widthPx
  })} {...(shouldCreateLink || shouldInvert || shouldNotZoom) && ({
    noZoom: "true"
  })} />
      <img className={`hidden dark:block ${shouldInvert ? "invert" : ""}`} src={darkSrc ?? src} alt={darkAlt ?? alt} {...height && ({
    height: heightPx
  })} {...width && ({
    width: widthPx
  })} {...(shouldCreateLink || shouldInvert || shouldNotZoom) && ({
    noZoom: "true"
  })} />
    </>;
  if (shouldCreateLink) {
    if (shouldCenter) {
      return <div style={{
        display: "flex",
        justifyContent: "center"
      }}>
          <a href={href} target={target ?? "_self"}>
            {images}
          </a>
        </div>;
    }
    return <a href={href} target={target ?? "_self"}>
        {images}
      </a>;
  }
  if (shouldCenter) {
    return <div style={{
      display: "flex",
      justifyContent: "center"
    }}>{images}</div>;
  }
  return images;
};

[TxTracer](https://txtracer.ton.org/) is a multipurpose debugging tool for TVM, Tolk, and FunC.

Tools from a screenshot are described below in their separate sections.

<Image src="/resources/images/txtracer/root.png" darkSrc="/resources/images/txtracer/root.png" alt="TxTracer screenshot" />

Its source code can be found on [GitHub](https://github.com/ton-blockchain/txtracer).

## 1. TxTracer

TxTracer's main tool allows stepping over TVM execution by transaction hash.

Put a transaction hash into the input. Use playback controls on the right to step through execution of the TVM bitcode that happened when this transaction was executed. Below those controls, the UI displays a current TVM stack.

<Image src="/resources/images/txtracer/transaction-light.png" darkSrc="/resources/images/txtracer/transaction-dark.png" alt="Screenshot of tracing by transaction hash" />

## 2. Playground

Playground is for stepping over arbitrary TVM Assembly (TASM) or FunC code.

Put the code into the code editor on the left. Use playback controls on the right to step through execution of the TVM bitcode that happened when this transaction was executed. Below those controls, the UI displays a current TVM stack.

<Image src="/resources/images/txtracer/playground-light.png" darkSrc="/resources/images/txtracer/playground-dark.png" alt="Screenshot of tracing some assembly" />

## 3. Code Explorer

Explorer converts FunC/Tolk code to TVM Assembly (TASM).

Put the code into the code editor on the left. The corresponding assembly code is on the right.

<Image src="/resources/images/txtracer/explorer-light.png" darkSrc="/resources/images/txtracer/explorer-dark.png" alt="Screenshot of conversion of FunC to assembly" />

## 4. TVM Specification

A modern version of TVM Specification.

Put instruction name into the search field. Read about description, stack signature, and other effects of the instruction.

<Image src="/resources/images/txtracer/spec-light.png" darkSrc="/resources/images/txtracer/spec-dark.png" alt="Screenshot of search in TVM specification by prefix 'pl'" />

## 5. Sandbox

Web interface that displays a trace from local [`@ton/sandbox`](/contract-dev/testing/reference).

Follow instructions on the main page of the tool on how to set it up. The tool displays a trace of what happened during execution of the code in a local `@ton/sandbox`.

<Image src="/resources/images/txtracer/sandbox-light.png" darkSrc="/resources/images/txtracer/sandbox-dark.png" alt="Screenshot of a sample trace" />

## 6. Emulate

Web interface that displays a trace from its [BoC](/foundations/serialization/boc).

<Image src="/resources/images/txtracer/emulate-light.png" darkSrc="/resources/images/txtracer/emulate-dark.png" alt="Screenshot of a sample trace" />
