Hardhat and Foundry are the two dominant tooling stacks for building, testing, and shipping Solidity smart contracts on Ethereum and other EVM-compatible chains, alongside the lighter-weight, browser-based Remix IDE for quick prototypes. A framework turns a folder of .sol files into a real engineering workflow: compiling against a pinned compiler version, spinning up a local chain (optionally forked from live mainnet state), running deployment scripts, and verifying the result on a block explorer. The two ecosystems solve the same problems with different philosophies: Hardhat is a JavaScript/TypeScript-driven, plugin-extensible task runner, while Foundry is a Rust-built, Solidity-native toolkit whose tests and scripts are written in the same language as the contracts themselves — and the two can even share a single project through the official hardhat-foundry compatibility plugin. This sheet focuses on the tooling layer: project setup, compilation, dependencies, local networks, deployment, and gas/debug tooling, leaving Solidity language syntax and deep testing methodology to their own cheat sheets.
What This Cheat Sheet Covers
This topic spans 14 focused tables and 139 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Framework and Tool Overview
Smart contract projects are built with a small set of purpose-built toolchains rather than general-purpose build tools, and knowing what each piece actually does is the first step before touching a config file. Hardhat and Foundry dominate production workflows, while Remix stays useful for quick, install-free experiments.
| Tool | Example | Description |
|---|---|---|
npx hardhat init | A TypeScript/JavaScript development environment that compiles, tests, debugs, and deploys contracts through an extensible task runner and plugin system. | |
foundryup | A fast, Rust-based toolkit bundling four command-line tools: Forge, Cast, Anvil, and Chisel. | |
forge build | Foundry's core tool for building, testing, debugging, deploying, and verifying Solidity contracts. | |
cast balance vitalik.eth --ether --rpc-url $RPC_URL | Command-line client for reading chain data, sending transactions, and encoding/decoding ABI data; works inside or outside a Foundry project. |