What is Foundry?

Foundry is a set of command-line tools for Ethereum development built in Rust. It started as a Paradigm project in late 2021 when they got tired of Hardhat being slow and wanted to write tests in Solidity instead of JavaScript.

The core pitch is simple: why learn JavaScript testing libraries when you already know Solidity? Instead of wrestling with Mocha, Chai, and ethers.js, you write your tests in the same language as your contracts. No more expect(await contract.getValue()).to.equal(42) bullshit - just assertEq(contract.getValue(), 42).

It's grown to 8.6k+ GitHub stars with hundreds of active contributors, which is pretty good for a tool that makes you throw out your existing JavaScript test suite.

The Four Tools

Foundry Architecture

Forge is the main compiler and test runner. It's fast because it's written in Rust and can compile multiple contracts in parallel. Unlike Hardhat, it doesn't recompile everything when you change one file - it actually does incremental compilation properly.

Cast is for interacting with deployed contracts from the command line. Think of it as a command-line wallet that can call contract functions, decode transaction data, and query blockchain state. Way more powerful than web3 scripts for debugging production issues.

Anvil is the local development node. It starts instantly (unlike Ganache) and can fork mainnet state without eating all your RAM. You can impersonate accounts, manipulate block timestamps, and generally mess with the blockchain in ways that help with testing.

Chisel is a Solidity REPL where you can test code snippets interactively. It's actually useful for figuring out how Solidity works without deploying contracts just to test simple expressions.

Installation Actually Works

Installation is refreshingly simple - no Node.js, no Python, no virtual environments:

curl -L https://foundry.paradigm.xyz | bash
foundryup

That's it. It downloads precompiled binaries for all four tools. The whole thing is under 100MB and doesn't conflict with anything else on your system. foundryup manages versions automatically, so you can switch between releases without breaking your projects.

Who Actually Uses This?

Major projects like OpenZeppelin, Uniswap, and Solmate have migrated from Hardhat. The migration isn't trivial - you have to rewrite all your tests from JavaScript to Solidity - but teams do it anyway because the speed gains are worth the long-term productivity improvements.

Documentation is solid in the Foundry Book, and there's active community support on Telegram and GitHub discussions. The project maintains regular releases with bug fixes and new features, including improved EIP support and enhanced debugging tools.

Foundry vs Other Ethereum Development Tools

Feature

Foundry

Hardhat

Truffle

Brownie

Language

Rust

JavaScript/TypeScript

JavaScript

Python

Test Language

Solidity

JavaScript/TypeScript

JavaScript

Python

Installation

curl | bash (50MB)

npm install (200MB+)

npm install

pip install

Compilation

Fast as hell

Okay

Meh

Slow

Test Execution

147x faster invariant tests

Slow

Slow

Really slow

Fuzz Testing

Built-in, works great

Hardhat-coverage plugin

Manual

Hypothesis integration

Invariant Testing

Native support

Not really

Nope

Nope

Local Node

Anvil (starts instantly)

Hardhat Network

Ganache

Ganache

Forking

Fast, cached properly

Works but slower

Basic

Basic

REPL

Chisel (Solidity)

Hardhat console (JS)

Truffle console (JS)

Brownie console (Python)

Gas Analysis

Built-in gas reports

Hardhat-gas-reporter

Basic

Basic

Dependencies

Git submodules

npm hell

npm hell

pip/requirements.txt

Configuration

foundry.toml

hardhat.config.js

truffle.config.js

brownie-config.yaml

Learning Curve

Steep if coming from JS

Easy for JS devs

Easy for JS devs

Easy for Python devs

Community

8.6k+ stars, growing fast

Huge, established

Large but stagnant

Small but active

Version

Latest releases

v2.22+

v5.11+

v1.20+

Status

Active, fast development

Mature, slower updates

Maintenance mode

Active

What You Actually Get

Foundry feels fast because it is fast, but the real win is that you can stop context-switching between languages. Here's what actually matters in day-to-day development:

Builds That Don't Waste Your Time

Foundry Build Performance

The compilation is legitimately faster than Hardhat - noticeable on any decent-sized codebase. More importantly, it only recompiles what changed, which Hardhat claimed to do but never really worked properly.

It automatically downloads and manages Solidity compiler versions, so you don't have to manually install solc or worry about version mismatches between your local machine and CI.

On larger projects (think OpenZeppelin Contracts size), you're looking at seconds instead of minutes for full rebuilds. Incremental builds are actually incremental.

Testing That Actually Catches Bugs

Fuzzing: Foundry can generate thousands of random inputs to test your contracts. This actually finds bugs that you missed in your manual test cases. It's fast enough to run in CI without making everyone hate you.

Invariant Testing: You can define properties that should always be true (like "total supply equals sum of all balances") and Foundry will try to break them by calling random functions in random orders. This catches the subtle bugs that come from weird interaction patterns in DeFi protocols.

Coverage-Guided Fuzzing: Introduced in v1.3.0 and refined in subsequent releases, this prioritizes inputs that exercise new code paths. It's like fuzzing but smarter about finding the weird edge cases in your contract logic - basically teaching the fuzzer to be more efficient at breaking your code.

Debugging When Things Go Wrong

Call Traces: When a transaction fails, Foundry shows you the exact call stack, including internal function calls and state changes. Way better than trying to decode revert messages from Etherscan.

Gas Profiling: Built-in gas reports show you exactly where your gas is going. You can see per-function gas usage and identify the expensive operations without installing additional tools like hardhat-gas-reporter.

Interactive Debugger: You can step through failed transactions line by line, inspect variable values, and see exactly where things went wrong. It actually works, unlike most smart contract debuggers.

The Pain Points

Git Submodules: Dependency management uses git submodules instead of npm packages. This is annoying if you're used to npm install, but it's deterministic and doesn't break when someone unpublishes a package.

Learning Curve: If you're coming from JavaScript testing, you need to learn Solidity testing patterns. The forge-std library helps, but it's still a mental shift from async/await patterns.

Migration Cost: Moving from Hardhat means rewriting all your tests. Depending on your test suite size, this could take days or weeks. Teams do it anyway because the long-term productivity gains are worth it, as shown by major projects migrating.

Current Status

Version v1.3.2 was released in August 2025. The project is actively maintained with regular bug fixes and new features. The community is growing fast, and major protocols are adopting it despite the migration costs.

Frequently Asked Questions

Q

What makes Foundry different from Hardhat or Truffle?

A

You write tests in Solidity instead of JavaScript. This means no more wrestling with async/await, ethers.js, or Mocha when debugging contract issues. Everything is in the same language, so when a test fails, you can read the test code and understand what's actually happening without translating between JavaScript and Solidity in your head.

Q

Is Foundry suitable for beginners to smart contract development?

A

If you're new to smart contracts but not new to programming, yes. The Foundry Book is well-written and doesn't assume you know JavaScript testing frameworks. However, if you're coming from web development and already know JavaScript, Hardhat might be easier initially. The tradeoff is short-term learning curve vs long-term productivity.

Q

How does Foundry handle external dependencies and package management?

A

Git submodules, which is weird if you're used to npm. Run forge install openzeppelin/openzeppelin-contracts and it clones the repo as a submodule. This means you get the exact code version and can't get rugpulled by someone unpublishing a package, but you need to understand how git submodules work. Most devs hate submodules until they understand them, then they realize they're actually more reliable than npm.

Q

Can I migrate an existing Hardhat or Truffle project to Foundry?

A

Yes, but it's not trivial. You have to rewrite all your Java

Script tests in Solidity, convert your deployment scripts to Foundry's scripting format, and set up a new foundry.toml config. For a large test suite, this could take weeks. Many teams run both tools in parallel during migration

  • keeping Hardhat for existing tests while writing new tests in Foundry.
Q

What are the system requirements for running Foundry?

A

Linux, macOS, or WSL on Windows. That's it. No Node.js, no Python virtual environments, no dependency conflicts. The binaries are self-contained and just work.

Q

Will this break my existing workflow?

A

Probably, yes. You'll need to learn new commands (forge test instead of npx hardhat test), rewrite tests if migrating, and get used to git submodules for dependencies. The disruption is temporary but real.

Q

How long does migration actually take?

A

Depends on your test suite size. Small project? Maybe a weekend. Large test suite with complex JavaScript logic? Could be weeks. The contract code itself doesn't change, just the tests and deployment scripts.

Q

What's the real learning curve?

A

If you know Solidity: maybe a week to get comfortable. If you're coming from JavaScript testing: expect 2-3 weeks to feel productive. The hardest part is learning to think in Solidity patterns instead of JavaScript async patterns.

Q

Does the speed improvement matter?

A

On small projects, not really. On larger codebases with lots of tests, absolutely. The difference between 30-second test runs and 5-minute test runs adds up when you're running tests constantly during development.

Q

Is it worth switching?

A

If you're starting fresh: probably. If you have a large existing Hardhat setup that works fine: maybe not. The ROI depends on how much time you spend waiting for tests and how much you value staying in Solidity for everything.

Essential Foundry Resources

Related Tools & Recommendations

compare
Similar content

Hardhat vs Foundry: Best Smart Contract Frameworks for Devs

Compare Hardhat vs Foundry, Truffle, and Brownie to pick the best smart contract framework. Learn which tools are actively supported and essential for modern bl

Hardhat
/compare/hardhat/foundry/truffle/brownie/framework-selection-guide
100%
tool
Similar content

Brownie Python Framework: The Rise & Fall of a Beloved Tool

RIP to the framework that let Python devs avoid JavaScript hell for a while

Brownie
/tool/brownie/overview
76%
tool
Similar content

Truffle is Dead: Smart Contract Migration & Alternatives

Explore why the Truffle framework was discontinued, its role in smart contract development, and essential migration options and alternatives for your decentrali

Truffle Suite
/tool/truffle/overview
72%
tool
Similar content

Hardhat Production Deployment: Secure Mainnet Strategies

Master Hardhat production deployment for Ethereum mainnet. Learn secure strategies, overcome common challenges, and implement robust operations to avoid costly

Hardhat
/tool/hardhat/production-deployment
66%
tool
Similar content

Debugging Broken Truffle Projects: Emergency Fix Guide

Debugging Broken Truffle Projects - Emergency Guide

Truffle Suite
/tool/truffle/debugging-broken-projects
62%
tool
Similar content

Alchemy Platform: Blockchain APIs, Node Management & Pricing Overview

Build blockchain apps without wanting to throw your server out the window

Alchemy Platform
/tool/alchemy/overview
55%
tool
Similar content

Hardhat Ethereum Development: Debug, Test & Deploy Smart Contracts

Smart contract development finally got good - debugging, testing, and deployment tools that actually work

Hardhat
/tool/hardhat/overview
43%
howto
Similar content

Deploy Smart Contracts on Optimism: Complete Guide & Gas Savings

Stop paying $200 to deploy hello world contracts. Here's how to use Optimism like a normal person.

/howto/deploy-smart-contracts-optimism/complete-deployment-guide
42%
howto
Similar content

Arbitrum Layer 2 dApp Development: Complete Production Guide

Stop Burning Money on Gas Fees - Deploy Smart Contracts for Pennies Instead of Dollars

Arbitrum
/howto/develop-arbitrum-layer-2/complete-development-guide
37%
tool
Similar content

Foundry Debugging - Fix Common Errors That Break Your Deploy

Debug failed transactions, decode cryptic error messages, and fix the stupid mistakes that waste hours

Foundry
/tool/foundry/debugging-production-errors
37%
tool
Similar content

Ethereum Overview: The Least Broken Crypto Platform Guide

Where your money goes to die slightly slower than other blockchains

Ethereum
/tool/ethereum/overview
35%
tool
Similar content

OP Stack: Optimism's Rollup Framework Explained

Discover OP Stack, Optimism's modular framework for building custom rollups. Understand its core components, setup process, and key considerations for developme

OP Stack
/tool/op-stack/overview
32%
tool
Similar content

Ethereum Layer 2 Development: EIP-4844, Gas Fees & Security

Because mainnet fees will bankrupt your users and your sanity

Ethereum
/tool/ethereum/layer-2-development
32%
tool
Similar content

Hardhat Advanced Debugging & Testing: Debug Smart Contracts

Master console.log, stack traces, mainnet forking, and advanced testing techniques that actually work in production

Hardhat
/tool/hardhat/debugging-testing-advanced
30%
alternatives
Recommended

Escaping Hardhat Hell: Migration Guide That Won't Waste Your Time

Tests taking 5 minutes when they should take 30 seconds? Yeah, I've been there.

Hardhat
/alternatives/hardhat/migration-difficulty-guide
29%
tool
Recommended

Stop Waiting 15 Minutes for Your Tests to Finish - Hardhat 3 Migration Guide

Your Hardhat 2 tests are embarrassingly slow and your .env files are a security nightmare. Here's how to fix both problems without destroying your codebase.

Hardhat
/tool/hardhat/hardhat3-migration-guide
29%
tool
Similar content

Viem: The Ethereum Library That Doesn't Suck - Overview

Discover Viem, the lightweight and powerful Ethereum library designed for modern Web3 development. Learn why it's a superior alternative to Ethers.js and how it

Viem
/tool/viem/overview
28%
tool
Similar content

Slither: Smart Contract Static Analysis for Bug Detection

Built by Trail of Bits, the team that's seen every possible way contracts can get rekt

Slither
/tool/slither/overview
28%
tool
Similar content

Base L2 Overview: The Layer 2 That Actually Works for Developers

Explore Base, Coinbase's Layer 2 solution for Ethereum, known for its reliable performance and excellent developer experience. Learn how to build on Base and un

Baserow
/tool/base/overview
27%
troubleshoot
Recommended

Docker Container Escape Prevention - Security Hardening Guide

Containers Can Escape and Fuck Up Your Host System

Docker
/troubleshoot/docker-container-escape-prevention/security-hardening-guide
25%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization