Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 14, 2026·3 min de lectura

Foundry — Blazing Fast Ethereum Development Toolkit in Rust

Foundry is a portable, modular toolkit for Ethereum smart contract development written in Rust. It includes Forge for testing, Cast for chain interaction, Anvil for local node simulation, and Chisel for an interactive Solidity REPL. Foundry compiles and runs tests significantly faster than JavaScript-based alternatives.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Foundry
Comando CLI universal
npx tokrepo install 2b86396f-4f90-11f1-9bc6-00163e2b0d79

Introduction

Foundry is an Ethereum development toolkit built in Rust by Paradigm. It replaces JavaScript-based workflows with native-speed tooling for compiling, testing, deploying, and interacting with smart contracts. Foundry has become the preferred toolkit for teams that write tests in Solidity rather than JavaScript.

What Foundry Does

  • Compiles Solidity and Vyper contracts with parallel compilation via forge build
  • Runs Solidity-native unit and fuzz tests at native speed with forge test
  • Provides cast CLI for sending transactions, querying chain state, and decoding calldata
  • Spins up a local Ethereum node with anvil for development and forked mainnet testing
  • Offers chisel, an interactive Solidity REPL for quick experimentation

Architecture Overview

Foundry is a set of Rust binaries sharing a common library layer. Forge handles project management, compilation (via solc), and test execution using a built-in EVM (revm). Anvil implements a full JSON-RPC server backed by revm, supporting mainnet forking at any block. Cast wraps common RPC calls and ABI encoding into one-line CLI commands. The toolkit uses the Alloy library for Ethereum type handling and RPC transport.

Self-Hosting & Configuration

  • Install via foundryup or build from source with cargo build --release
  • Configure project settings in foundry.toml (Solidity version, optimizer runs, RPC URLs)
  • Use forge install to manage Solidity dependencies as Git submodules
  • Set ETH_RPC_URL environment variable for default chain interaction
  • Fork mainnet with anvil --fork-url <RPC_URL> for realistic integration tests

Key Features

  • Fuzz testing with configurable runs and shrinking for finding edge cases
  • Mainnet forking in Anvil lets you test against live contract state
  • Gas snapshots (forge snapshot) track contract gas usage across commits
  • Cheatcodes in tests allow time manipulation, storage overrides, and impersonation
  • Script system (forge script) deploys contracts with simulation before broadcast

Comparison with Similar Tools

  • Hardhat — JavaScript-based with a rich plugin ecosystem; Foundry is faster and uses Solidity for tests
  • Brownie — Python-based framework now largely unmaintained; Foundry is actively developed
  • Truffle — Early Ethereum framework; Foundry offers modern DX and superior test speed
  • Ape — Python framework by ApeWorX; Foundry appeals to developers preferring Solidity-native testing

FAQ

Q: Can I use Foundry alongside Hardhat? A: Yes. Many teams use Forge for testing and Hardhat for deployment scripts or plugins. The two can coexist in the same repository.

Q: Does Foundry support Vyper? A: Foundry supports compiling Vyper contracts, though the primary testing workflow targets Solidity.

Q: How does fuzz testing work in Forge? A: Forge generates random inputs for test function parameters and runs them many times (default 256 runs). Failing inputs are automatically minimized to the simplest reproducing case.

Q: Is Foundry production-ready? A: Yes. Major protocols including Uniswap, Optimism, and Paradigm use Foundry in production.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados