⚡ Problem with Remix & Hardhat:
In Remix, every tiny code change requires you to manually redeploy the contract and re-test every function via the UI. This is slow, manual, and doesn’t scale.
Hardhat is powerful but relies on JavaScript for tests, which can be a barrier if you only know Solidity.
🎯 Foundry’s Solution:
- Write tests in Solidity 🧪
- Run all tests with one command (
forge test)- Tests run on a local EVM (via
anvil) — super fast ⚡- Supports Unit, Fuzz, Invariant, Forking, and Differential tests
- Interact with contracts via CLI using
cast🖥️- Deploy contracts using Solidity scripts 📜
✅ Key Advantages:
- Speed ⚡
- Automation 🤖
- Solidity-only workflow 🧱
- Powerful CLI tools (
forge,cast,anvil,chisel)- Gas reporting, cheatcodes, and more!
Foundry’s CLI tools don’t work well with Windows PowerShell or CMD.
✅ Solutions:
- Install WSL (Windows Subsystem for Linux) — Recommended
- Follow Microsoft’s official WSL setup guide.
- Install Git, configure your email, etc.
- Use Git Bash — A simpler alternative that comes with Git for Windows.
🍎 Mac/Linux Users: You’re good to go!
Use the official foundryup installer script.
# Download and run the installer
curl -L <https://foundry.paradigm.xyz> | bash
# Initialize Foundry (installs forge, cast, anvil, chisel)
foundryup
✅ Verify Installation:
forge --version
cast --version
anvil --version
chisel --version
You should see version numbers for all tools.