> ## 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.

# 调试交易

> 在 Virtual Environment 上重放和调试交易，单步执行其运行过程，并检查状态变化和 revert 原因。

[Tenderly Debugger](/debugger/overview) 支持在 Virtual Environment 上执行的交易。您可以使用它检查和调试在 Virtual Environment 上执行的交易，功能与调试真实交易时相同。

要使 Debugger 工作，它需要来自在父网络、Tenderly 或 Virtual Environment 上已验证的合约。

在 **Virtual Environment Explorer** 中单击任意交易，然后单击 **Debugger** 即可访问 Debugger。

[在 Loom 上观看 →](https://www.loom.com/share/09413e8a867f4ddeaa41a5080d771895?sid=b8f60cda-fcb8-401b-ba9a-8bb69630fe9a)

Debugger 如何帮助您查找和修复交易错误？

* 浏览任意交易的函数调用。
* 分析发出的事件和状态变化。
* 使用 [Gas Profiler](/debugger/gas-profiler) 获取准确的 gas 使用详情。

如果调试揭示您正在检查的智能合约中存在逻辑错误，您可以使用 [Simulator UI](/simulator-ui/overview) 并通过 **Edit Source Code** 针对修复后的代码运行失败的交易。这是在将修复应用到代码库并重新部署之前验证 bug 修复的快速方法。
