Auto-sync: 2026-04-21 17:12

This commit is contained in:
2026-04-21 17:12:45 +08:00
parent 914c8f6925
commit 0fe7ba237f
1888 changed files with 220 additions and 68174 deletions

View File

@@ -1,38 +0,0 @@
---
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]]