tronbox

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
The 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
--evm
flag. Migrations and tests use ethers v6 in EVM mode and TronWeb for TVM.
本技能基于TronBox v4.5.0,生成于2026-02-25。
TronBox是一款类Truffle风格的TRON开发框架:支持智能合约编译、迁移、测试,以及交互式控制台功能。它通过独立配置文件和
--evm
标志,同时支持原生TRON虚拟机(TVM)与EVM兼容链(如BTTC)。在EVM模式下,迁移与测试使用ethers v6;在TVM模式下则使用TronWeb。

Core References

核心参考文档

TopicDescriptionReference
Configurationtronbox.js / tronbox-evm-config.js, networks, paths, solccore-config
Migrations & DeployerMigration scripts, deploy/link/then API, context (artifacts, tronWeb, ethers)core-migrations
CompileCompiling contracts, --all / --evm, build outputcore-compile
Testingtronbox test, test discovery, artifacts in testscore-testing
ConsoleInteractive REPL with contract abstractionscore-console
CLIAll commands and optionscore-cli
Artifacts & ResolverBuild output shape, resolver order, artifacts.require / resolvecore-artifacts-resolver
Contract abstractionnew(), at(), deployed(), call(), link, defaultscore-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

功能特性

TopicDescriptionReference
EVM modeEVM chains, tronbox-evm-config.js, --evm, ethersfeatures-evm
Init & Unboxtronbox init (sample/MetaCoin), unbox templatesfeatures-init-unbox
FlattenFlatten contracts and dependencies to single file (verification/auditing)features-flatten
DeployAlias for migrate; same options and behaviorfeatures-deploy
TronWrap & providerTronWeb/ethers context, waitForTransactionReceipt, TREfeatures-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方法、TREfeatures-tronwrap

Best Practices

最佳实践

TopicDescriptionReference
Environment & networksEnvironment.detect, default network, network_id/from, common errorsbest-practices-environment
Errors & exit behaviorTaskError, config/compile/migrate errors, exit codesbest-practices-errors
主题描述参考链接
环境与网络配置Environment.detect方法、默认网络、network_id/from配置、常见错误best-practices-environment
错误与退出行为TaskError、配置/编译/迁移错误、退出码best-practices-errors