tronbox
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe skill is based on TronBox v4.5.0, generated at 2026-02-25.
TronBox is a Truffle-style framework for TRON: smart contract compilation, migrations, testing, and an interactive console. It supports both the native TRON Virtual Machine (TVM) and EVM-compatible chains (e.g. BTTC) via a separate config and the flag. Migrations and tests use ethers v6 in EVM mode and TronWeb for TVM.
--evm本技能基于TronBox v4.5.0,生成于2026-02-25。
TronBox是一款类Truffle风格的TRON开发框架:支持智能合约编译、迁移、测试,以及交互式控制台功能。它通过独立配置文件和标志,同时支持原生TRON虚拟机(TVM)与EVM兼容链(如BTTC)。在EVM模式下,迁移与测试使用ethers v6;在TVM模式下则使用TronWeb。
--evmCore References
核心参考文档
| Topic | Description | Reference |
|---|---|---|
| Configuration | tronbox.js / tronbox-evm-config.js, networks, paths, solc | core-config |
| Migrations & Deployer | Migration scripts, deploy/link/then API, context (artifacts, tronWeb, ethers) | core-migrations |
| Compile | Compiling contracts, --all / --evm, build output | core-compile |
| Testing | tronbox test, test discovery, artifacts in tests | core-testing |
| Console | Interactive REPL with contract abstractions | core-console |
| CLI | All commands and options | core-cli |
| Artifacts & Resolver | Build output shape, resolver order, artifacts.require / resolve | core-artifacts-resolver |
| Contract abstraction | new(), at(), deployed(), call(), link, defaults | core-contract-abstraction |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 配置 | tronbox.js / tronbox-evm-config.js、网络配置、路径、solc编译器 | core-config |
| 迁移与部署器 | 迁移脚本、deploy/link/then API、上下文对象(artifacts、tronWeb、ethers) | core-migrations |
| 编译 | 合约编译、--all / --evm参数、构建输出 | core-compile |
| 测试 | tronbox test命令、测试用例发现、测试中的artifacts使用 | core-testing |
| 控制台 | 带合约抽象的交互式REPL环境 | core-console |
| 命令行界面 | 所有命令及选项 | core-cli |
| 产物与解析器 | 构建输出结构、解析顺序、artifacts.require / resolve方法 | core-artifacts-resolver |
| 合约抽象 | new()、at()、deployed()、call()、link、defaults方法 | core-contract-abstraction |
Features
功能特性
| Topic | Description | Reference |
|---|---|---|
| EVM mode | EVM chains, tronbox-evm-config.js, --evm, ethers | features-evm |
| Init & Unbox | tronbox init (sample/MetaCoin), unbox templates | features-init-unbox |
| Flatten | Flatten contracts and dependencies to single file (verification/auditing) | features-flatten |
| Deploy | Alias for migrate; same options and behavior | features-deploy |
| TronWrap & provider | TronWeb/ethers context, waitForTransactionReceipt, TRE | features-tronwrap |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| EVM模式 | EVM兼容链、tronbox-evm-config.js配置、--evm参数、ethers库 | features-evm |
| 初始化与模板项目 | tronbox init(示例项目/MetaCoin)、unbox模板 | features-init-unbox |
| 合约合并 | 将合约及依赖合并为单个文件(用于验证/审计) | features-flatten |
| 部署 | migrate命令的别名;参数与行为完全一致 | features-deploy |
| TronWrap与提供者 | TronWeb/ethers上下文、waitForTransactionReceipt方法、TRE | features-tronwrap |
Best Practices
最佳实践
| Topic | Description | Reference |
|---|---|---|
| Environment & networks | Environment.detect, default network, network_id/from, common errors | best-practices-environment |
| Errors & exit behavior | TaskError, config/compile/migrate errors, exit codes | best-practices-errors |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 环境与网络配置 | Environment.detect方法、默认网络、network_id/from配置、常见错误 | best-practices-environment |
| 错误与退出行为 | TaskError、配置/编译/迁移错误、退出码 | best-practices-errors |