explaingit

foundry-rs/foundry

10,343RustAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A fast Rust-based toolkit for Ethereum smart contract developers, write, test, fuzz, and deploy Solidity contracts from the command line.

Mindmap

mindmap
  root((foundry))
    Tools
      Forge build and test
      Cast blockchain CLI
      Anvil local node
      Chisel Solidity REPL
    Testing
      Unit tests
      Fuzz testing
      Deployment scripts
    Target chain
      Ethereum
      EVM compatible
    Audience
      Smart contract devs
      Blockchain engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Write and run automated tests for Solidity smart contracts, including fuzz tests that auto-generate edge-case inputs.

USE CASE 2

Spin up a local Ethereum node with Anvil to develop and test contracts without spending real cryptocurrency.

USE CASE 3

Deploy a Solidity contract to a testnet or mainnet using Forge from a single terminal command.

USE CASE 4

Interactively explore and debug Solidity code expressions one line at a time using the Chisel REPL.

Tech stack

RustSolidity

Getting it running

Difficulty · moderate Time to first run · 30min

Requires familiarity with Solidity and Ethereum concepts, installation is two terminal commands but the learning curve for smart contract development is steep.

Use freely for any purpose, including commercial projects, under your choice of the Apache 2.0 or MIT license.

In plain English

Foundry is a development toolkit for building and testing smart contracts on Ethereum. Ethereum is a blockchain platform where programs called smart contracts run on a decentralized network. Writing and deploying those contracts requires specialized tooling, and Foundry provides a full suite of command-line tools for that work. The toolkit ships four main components. Forge handles building, testing, fuzzing, and deploying Solidity contracts. Solidity is the most common programming language for writing Ethereum smart contracts. Forge's testing capabilities include fuzz testing, which automatically generates many different inputs to find edge cases and bugs. Cast is a general-purpose command-line tool for reading data from the blockchain and sending transactions, described in the README as a Swiss Army knife for interacting with the Ethereum network. Anvil is a local Ethereum node you run on your own machine for development and testing, so you can experiment without using real money or connecting to the live network. Chisel is an interactive Solidity environment, letting developers type and evaluate code expressions one at a time. The project is written in Rust and emphasizes speed. Installation takes two commands from a terminal: a download script, then a second command that fetches the tools. No package manager setup or build process is required for users who just want to use the tools. Foundry is aimed at developers who write Ethereum smart contracts professionally or as a hobby. It assumes familiarity with Solidity and blockchain concepts. Full documentation is available on the project website. The code is open source under a dual Apache 2.0 and MIT license, and community discussion happens on a public Telegram channel.

Copy-paste prompts

Prompt 1
I'm writing my first Solidity ERC-20 token contract. Show me how to set up a Foundry project, write a basic Forge test for the transfer function, and run fuzz testing against it.
Prompt 2
Walk me through using Anvil to start a local Ethereum node, deploy a contract to it with Forge, and then call a read function on that contract using Cast.
Prompt 3
I have a deployed contract on Sepolia testnet. Write the Cast command to read a specific storage slot value and call a view function on it.
Prompt 4
How do I set up Chisel in Foundry to interactively test a Solidity function expression without writing a full contract file?
Open on GitHub → Explain another repo

← foundry-rs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.