
Foundry
Blazing fast Ethereum smart contract development toolkit
Replaces —

Who it's for
Use Forge to write tests in Solidity, run fuzz tests to surface edge cases, and deploy verified contracts to mainnet or testnets — all without leaving the terminal.
Fork mainnet with Anvil to simulate interactions with real DeFi protocols, token contracts, or DAOs before deploying integration code, avoiding costly on-chain mistakes.
You only work with testnets or fully mocked environments
Use Cast to inspect on-chain contract state, decode calldata, and query historical transactions from the CLI during a security review. Chisel allows quick Solidity snippet execution to verify assumptions.
Run the full test suite with Forge's built-in fuzz testing to stress-test invariants across randomized inputs, catching edge cases in financial logic before mainnet deployment.
You are building non-financial or non-EVM contracts
The problem
Ethereum smart contract developers have historically needed multiple disconnected tools, often written in JavaScript, to build, test, deploy, and interact with contracts. Switching between Solidity and JavaScript for tests adds friction, and slow compilation and test cycles slow iteration. Foundry consolidates the full development lifecycle into one fast, Rust-powered toolkit where tests are written in Solidity.
How it works
Forge is the core build and test tool. It compiles Solidity contracts, runs unit and fuzz tests written in Solidity, debugs contract execution, and handles deployment and verification — all from the CLI.
Anvil is a fast local Ethereum development node. Run `anvil --fork-url <rpc>` to fork mainnet or any EVM-compatible chain locally, enabling realistic end-to-end testing against real on-chain state without spending gas.
Cast is a command-line tool for interacting with EVM smart contracts and querying chain data. Use it to check block numbers, query balances by ENS name, send transactions, and call contract functions from a terminal.
Chisel is a fast, utilitarian Solidity REPL for rapid prototyping and debugging. Write and execute Solidity snippets interactively without setting up a full project.
Run `forge lsp` from any Solidity project to open VS Code with a bundled Solidity extension. For other editors, configure the LSP client to run `forge lsp --stdio`. No separate Solar installation or extension build is required.
Foundry's test framework lets developers write tests in Solidity rather than JavaScript or TypeScript. This keeps the entire workflow in one language and avoids the overhead of a separate JS test runner.
Features
- Forge: build, test, fuzz, and deploy
- Anvil: local Ethereum node with forking
- Cast: CLI chain interaction
- Chisel: Solidity REPL
- Solidity language server (forge lsp)
- Tests written in Solidity
How to install
curl -L https://getfoundry.sh/install | bash && foundryup
Recommended for this setup
Strengths
- Written in Rust for speed: Foundry's Rust implementation makes compilation and test execution significantly faster than toolchains built on Node.js, reducing iteration time on large contract suites.
- Single-language workflow: Because tests are written in Solidity, developers stay in one language across the entire project. There is no need to context-switch into JavaScript just to write or maintain tests.
- Mainnet forking built in: Anvil's `--fork-url` flag lets developers spin up a local node that mirrors live chain state in one command, making it straightforward to test against real protocols and token balances.
- Modular and portable: Foundry is designed to be portable and modular. It installs via a single curl command, works on any platform, and individual tools (Forge, Cast, Anvil, Chisel) can be used independently.
Trade-offs
- Ethereum and EVM only: Foundry targets Ethereum and EVM-compatible chains. It is not a general-purpose smart contract toolkit and does not support non-EVM blockchains such as Solana or Cosmos.
- Solidity-centric: The framework is built around Solidity. Vyper support exists but is secondary; developers primarily working in Vyper may find the tooling less complete.
- Command-line first: Foundry is a CLI toolkit with no built-in GUI. Teams that prefer a graphical development environment will need to pair it with a separate IDE plugin or use the VS Code LSP integration.
Tech stack
FAQ
Run `curl -L https://getfoundry.sh/install | bash` followed by `foundryup`. This installs the foundryup version manager and all four tools: Forge, Cast, Anvil, and Chisel.
No. Tests in Foundry are written in Solidity, so you can work entirely in Solidity without a JavaScript or TypeScript test runner.
Yes. Run `anvil --fork-url <rpc-url>` to start a local Ethereum node that forks live mainnet state. Your tests can interact with real deployed contracts and token balances without spending gas.
Yes. Run `forge lsp` from your project directory to open VS Code with a bundled Solidity extension. No separate extension build or Solar installation is required.
Foundry is dual-licensed under the Apache License 2.0 and the MIT license. You may choose either license at your option.