Files
nexus/wiki/entities/Foundry.md
2026-04-21 00:02:55 +08:00

1.0 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Foundry entity
tool
development-framework
testing
blockchain-security-auditor
2026-04-20

定义

Foundry 是以太坊开发框架,包含 Forge智能合约测试工具和 Cast交互工具使用 Solidity 编写测试,支持高速测试执行和模糊测试。

核心功能

  • Forge:智能合约测试框架
  • Cast:链上交互 CLI
  • Anvil:本地测试网络
  • ChiselSolidity REPL

在审计中的应用

// Foundry Exploit PoC 示例
contract FlashLoanOracleExploitTest is Test {
    function test_oracleManipulationExploit() public {
        // 复现漏洞的 Foundry 测试
    }
}

与传统测试对比

特性 Forge Hardhat
语言 Solidity JavaScript/TypeScript
速度 Rust 较慢
Fuzzing 内置 需集成 Echidna

Connections