Ethereum development environment for compiling, deploying, testing, and debugging smart contracts and dapps.
foundry-rs/foundry
Rust-based toolkit for Ethereum smart contract development, with Forge, Cast, Anvil and Chisel for building, testing, and interacting with EVM chains.
Open-source alternative to:Hardhat
- Stars
- 10,685
- Forks
- 2,686
- Open issues
- 246
- Last commit
- 3 hours ago
What is it?
Foundry is a toolkit for developing Ethereum applications, written in Rust. It bundles four tools: Forge for building, testing, fuzzing, debugging and deploying Solidity contracts; Cast for calling contracts, sending transactions and reading chain data from the command line; Anvil, a local Ethereum development node that can fork a live network; and Chisel, a Solidity REPL.
A typical workflow starts with forge init to scaffold a project, then forge build and forge test. Anvil can fork mainnet locally so contracts can be tested against real on-chain state, and Cast queries live RPC endpoints for balances, block numbers and similar data. The project also provides a language server for Solidity, which can be run through forge lsp and used from VS Code or other editors that support LSP.
Foundry is modular, so each tool can be used on its own or together with the others. It is dual-licensed under Apache-2.0 and MIT.
Key features
- 01Forge builds, tests, fuzzes and deploys Solidity contracts.
- 02Cast interacts with EVM chains and contracts from the command line.
- 03Anvil runs a local Ethereum node and can fork a live network.
- 04Chisel provides a Solidity REPL for quick experiments.
- 05forge lsp provides a Solidity language server for editors.
Use cases
- Writing and unit-testing Solidity smart contracts locally.
- Testing contracts against forked mainnet state with Anvil.
- Querying balances and chain data from scripts or the terminal with Cast.
- Setting up Solidity editor support in VS Code or other LSP-capable editors.
Quick start
- 1
Run the official install script from the README
- 2
Install the toolkit with foundryup
foundryup - 3
Initialize a new project
forge init counter && cd counter - 4
Build the project, then run forge test
forge build
Topics
FAQ
- What is foundry?
- Rust-based toolkit for Ethereum smart contract development, with Forge, Cast, Anvil and Chisel for building, testing, and interacting with EVM chains. Foundry is a toolkit for developing Ethereum applications, written in Rust. It bundles four tools: Forge for building, testing, fuzzing, debugging and deploying Solidity contracts; Cast for calling contracts, sending transactions and reading chain data from the command line; Anvil, a local Ethereum development node that can fork a live network; and Chisel, a Solidity REPL.
- Is foundry free to use? What license does it have?
- foundry is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is foundry still maintained?
- Actively maintained. The last commit to foundry was on Oct 21, 2026.
- What can I use foundry for?
- Writing and unit-testing Solidity smart contracts locally. Testing contracts against forked mainnet state with Anvil. Querying balances and chain data from scripts or the terminal with Cast. Setting up Solidity editor support in VS Code or other LSP-capable editors.
- How do I install foundry?
- Run the official install script from the README Install the toolkit with foundryup: foundryup Initialize a new project: forge init counter && cd counter Build the project, then run forge test: forge build
- Where can I get foundry?
- The source code and installation instructions are on GitHub: https://github.com/foundry-rs/foundry
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Solidity is a statically-typed, contract-oriented programming language for writing smart contracts on the Ethereum platform.
Sway is a Rust-inspired programming language for writing smart contracts on the Fuel blockchain.
Go implementation of the Ethereum execution layer, running as a full or archive node with JSON-RPC access and developer tools.
The second edition of "Mastering Ethereum", a book covering Ethereum development, smart contracts, and the network's underlying technology.
Chainlink core node and contracts for running a decentralized oracle network that brings real-world data and off-chain computation to smart contracts.