Solidity Foundry Development Rules

5/28/2025

这些规则涵盖了使用 Foundry 进行 Solidity 智能合约开发的通用准则、最佳实践、测试、性能优化、开发工作流程、文档、依赖管理和环境配置。强调代码质量、安全性和效率。


    # via_ir pipeline is very slow - use a separate profile to pre-compile and then use vm.getCode to deploy
[profile.via_ir]
via_ir = true
# do not compile tests when compiling via-ir
test = 'src'
out = 'via_ir-out'
```

- When deterministic deployment is required:

```
[profile.deterministic]
# ensure that block number + timestamp are realistic when running tests
block_number = 17722462
block_timestamp = 1689711647
# don't pollute bytecode with metadata
bytecode_hash = 'none'
cbor_metadata = false
```