# 链上调试

### **交易反馈与追踪**

* [Tenderly](https://dashboard.tenderly.co/explorer)
* [EthTx Transaction Decoder](https://ethtx.info/)
* <https://openchain.xyz/>
* [Bloxy](https://bloxy.info/)
* <https://github.com/naddison36/tx2uml>：生成 UML 图表的操作系统工具
* <https://github.com/apeworx/evm-trace>： 追踪工具

### **合约反编译**

* <https://oko.palkeo.com/>：[Panoramix](https://github.com/palkeo/panoramix) 反编译器的托管版本

### **本地节点**

开发人员通常会发现，运行一个修改了参数的以太坊单节点，对交互测试很有帮助：

* [Anvil](https://github.com/foundry-rs/foundry/tree/master/crates/anvil) 是一个打包在 Foundry 工具包中的本地以太坊节点。
* [Hardhat](https://hardhat.org/hardhat-network/docs/overview) 是一个打包在 Hardhat 工具包中的本地以太坊节点。

如何安装相应工具包，并获得本地节点，下一章节将详细介绍。

### **工具包**

开发人员通常会发现，在一个功能齐全的开发框架内构建自己的程序能提高开发效率。开发框架可以组织外部依赖关系（即软件包管理），组织单元测试和集成测试，定义部署程序（针对本地节点、测试网和主网），记录Gas成本等。

以下是两种最常用的 Solidity 开发工具包：

* [Foundry](https://book.getfoundry.sh/) 是一个用于开发和测试的 Solidity 开发框架，Foundry 可以管理依赖关系、编译项目、运行测试、部署，并允许用户通过命令行或 Solidity 脚本与链进行交互，Foundry 用户通常使用 Solidity 语言编写智能合约和测试。
* [Hardhat](https://hardhat.org/docs) 是一个 Solidity 开发框架，搭配有 JavaScript 测试框架，它具有与 Foundry 类似的功能，在 Foundry 出现之前是 EVM 开发人员的主要工具链。

### **与以太坊 RPC API 交互**

去中心化应用程序的前端通常使用 JavaScript 或 Python 向 RPC 节点提交读取或写入查询，这些代码通常被称为 "客户端"，因为开发人员可以将区块链大致等同于后台服务器。

以下资源库提供了向 RPC 节点提交查询或交易的标准方法：

* Python:
  * [web3.py](https://web3py.readthedocs.io/en/stable/)
* Javascript:
  * [web3.js](https://web3js.readthedocs.io/)
  * [ethers.js](https://docs.ethers.org/) 开发了 [Web3.js](https://web3js.readthedocs.io/en/v1.10.0/getting-started.html) 和 [Web3.py](https://web3py.readthedocs.io/en/stable/quickstart.html)，它们分别是 Java Script 和 Python 资源库，这些开发旨在使开发人员能够更直观地与区块链进行交互。

这里是一个创建去中心化应用程序前端的快速示例：[create-eth-app](https://github.com/WalletConnect/create-eth-app)。

### **测试网**

Monad 测试网将在未来几个月内提供给开发者使用，由于字节码和 RPC 与 EVM 兼容，计划在 Monad 上部署的开发者可以初步使用[以太坊测试网](https://ethereum.org/en/developers/docs/networks/)。

### 更多资源

以下子页面添加了额外资源：

* [EVM behavior](/guides/evm-resources/evm-behavior.md)
* [更多 Solidity 资源](/guides/evm-resources/solidity-resources.md)
* [链上调试](/guides/evm-resources/debugging-on-chain.md)
* [其他编程语言](/guides/evm-resources/other-languages.md)
  * [Vyper](/guides/evm-resources/other-languages/vyper.md)
  * [Huff](/guides/evm-resources/other-languages/huff.md)

除了 "[建议资源](/guides/evm-resources.md) "中提到的资源外，这里还有一些其他资源：

### **教程**

* [Ethernaut](https://ethernaut.openzeppelin.com/)：通过解谜学习 Solidity

### **最佳实践/模式**

* [DeFi开发人员路线图](https://github.com/OffcierCia/DeFi-Developer-Road-Map)
* [Gas优化技能书](https://www.rareskills.io/post/gas-optimization)

### **测试**

* [Echidna](https://github.com/crytic/echidna)：模糊测试
* [Slither](https://github.com/crytic/slither)：用于漏洞检测的静态分析
* [solidity-coverage](https://github.com/sc-forks/solidity-coverage/tree/master)：测试 Solidity 代码覆盖率

### **智能合约存档**

*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://monad.docszh.com/guides/evm-resources/debugging-on-chain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
