Loading...
Loading...
Compare original and translation side by side
apps/eth-contracts/apps/eth-contracts/git-workflowgit-workflow| Path | Description |
|---|---|
| Smart contract source files |
| Foundry deployment scripts |
| Foundry test files ( |
| 路径 | 说明 |
|---|---|
| 智能合约源文件 |
| Foundry部署脚本 |
| Foundry测试文件( |
| Tool | Version | Role |
|---|---|---|
Foundry ( | 1.6.0-nightly | Compile, test, deploy |
| Solidity | | Smart contract language |
| OpenZeppelin Contracts | | ERC-20 / standard base contracts |
| bun | primary | npm package manager |
| solhint | | Solidity linter |
| dprint | | JS/TS formatter |
Note:is installed atforge(may not be in PATH). Run with full path or add~/.foundry/bin/forgeto~/.foundry/bin.PATH
| 工具 | 版本 | 作用 |
|---|---|---|
Foundry ( | 1.6.0-nightly | 编译、测试、部署 |
| Solidity | | 智能合约开发语言 |
| OpenZeppelin Contracts | | ERC-20/标准基础合约 |
| bun | 首选 | npm包管理器 |
| solhint | | Solidity代码检查工具 |
| dprint | | JS/TS格式化工具 |
注意:安装路径为forge(可能不在PATH中),请使用完整路径执行,或将~/.foundry/bin/forge添加到~/.foundry/bin。PATH
cd apps/eth-contractscd apps/eth-contractsundefinedundefinedcd apps/eth-contracts
forge build # Compile all contracts (artifacts → out/)
forge test -v # Run Foundry unit tests
bun run lint # Solidity lint via solhint (must exit 0, zero errors)
bun run fmt # Format JS/TS files via dprint (must exit 0)cd apps/eth-contracts
forge build # 编译所有合约(产物输出到out/目录)
forge test -v # 运行Foundry单元测试
bun run lint # 通过solhint执行Solidity代码检查(必须返回退出码0,无错误)
bun run fmt # 通过dprint格式化JS/TS文件(必须返回退出码0)cd apps/eth-contracts
export PRIVATE_KEY=0x<deployer-private-key>
forge script script/DeployHYC.s.sol --rpc-url http://localhost:8545 --broadcastcd apps/eth-contracts
export PRIVATE_KEY=0x<部署账户私钥>
forge script script/DeployHYC.s.sol --rpc-url http://localhost:8545 --broadcast
Compatible with both `anvil` and `geth` nodes at `http://localhost:8545`.
兼容运行在`http://localhost:8545`的`anvil`和`geth`节点。import {Foo} from "..."@title@author@notice@paramimport {Foo} from "..."@title@author@notice@param.env.gitignore.env.gitignoretest/*.t.solforge testbun run linttest/*.t.solforge testbun run lintundefinedundefinedundefinedundefinedanvilgethhttp://localhost:8545http://localhost:8545anvilgethgit-workflowgithub-issue-creationgit-workflowgithub-issue-creation