Auto-sync: 2026-04-21 00:02

This commit is contained in:
2026-04-21 00:02:55 +08:00
parent 177469a1cd
commit cb7c11e14f
235 changed files with 16567 additions and 237 deletions

38
wiki/entities/Foundry.md Normal file
View File

@@ -0,0 +1,38 @@
---
title: "Foundry"
type: entity
tags: [tool, development-framework, testing]
sources: [blockchain-security-auditor]
last_updated: 2026-04-20
---
## 定义
Foundry 是以太坊开发框架,包含 Forge智能合约测试工具和 Cast交互工具使用 Solidity 编写测试,支持高速测试执行和模糊测试。
## 核心功能
- **Forge**:智能合约测试框架
- **Cast**:链上交互 CLI
- **Anvil**:本地测试网络
- **Chisel**Solidity REPL
## 在审计中的应用
```solidity
// Foundry Exploit PoC 示例
contract FlashLoanOracleExploitTest is Test {
function test_oracleManipulationExploit() public {
// 复现漏洞的 Foundry 测试
}
}
```
## 与传统测试对比
| 特性 | Forge | Hardhat |
|------|-------|---------|
| 语言 | Solidity | JavaScript/TypeScript |
| 速度 | 快Rust | 较慢 |
| Fuzzing | 内置 | 需集成 Echidna |
## Connections
- [[Smart Contract Testing]] ← provides ← [[Foundry]]
- [[Invariant Verification]] ← supports ← [[Foundry]]