Your first ERC-20 token with Hardhat
Create an ERC-20 token using OpenZeppelin, test basic transfers and deploy to a testnet with a single Hardhat script.
Short, practical guides that feel like pair-programming with a senior Solidity dev: Hardhat scripts, Foundry tests, OpenZeppelin patterns, security checklists and more.
These guides are designed to be followed in a single sitting. You’ll end each one with a working contract, tests and a deployment.
Filter by level or focus area. Combine multiple guides to build your own full-stack web3 project.
Create an ERC-20 token using OpenZeppelin, test basic transfers and deploy to a testnet with a single Hardhat script.
Learn how to write unit tests, fuzz tests and invariants using Foundry. Turn your contracts into something you actually trust.
Add snapshots, pausing and role-based access control to your token using OpenZeppelin extensions.
Understand reentrancy with a vulnerable contract, exploit it in tests and then fix it the right way.
Model basic lending logic and use Foundry’s invariant tests to make sure funds never disappear by accident.
Learn a simple deployment story: from local Hardhat Network to Sepolia and finally to mainnet.
These aren’t made-up examples. They’re the same patterns you’ll use in client work, hackathons or your own protocol.
Combine multiple guides into a mini-curriculum: from basic tokens to upgradable vaults interacting with DeFi.
Learn how to structure Hardhat scripts so you can reuse them across projects: clean configs, named accounts, environment variables and safety checks before mainnet.
Get comfortable with Foundry’s testing style: cheats, time travel, fuzzing, and invariants that encode “this protocol must never do X”.
Understand common pitfalls like reentrancy, unsafe external calls and broken access control — and see how OpenZeppelin helps avoid them.
Follow one of these paths if you don’t want to think about where to start. Just open the next guide and keep going.
You can always jump between paths. The stack (Hardhat + Foundry + OZ) stays the same — you just use it at different depths.
Hardhat gives you a friendly interface to your contracts: scripts, deployments, tasks and plugin ecosystem. Foundry lets you stress-test the same contracts with native Solidity tests.
OpenZeppelin provides secure building blocks that sit at the very core. Your job is to wire these layers together in a way that is safe, simple and transparent for users.
Here’s what a minimal but serious first project looks like. Several guides walk you through each step in detail.
You don’t have to memorize any of this. Just open the relevant guide when you reach that step.
Initialize a TypeScript Hardhat project, configure networks and create a clean folder layout for contracts, scripts and tests.
Use OpenZeppelin for ERC-20 or simple vault logic. Keep the contract small, readable and easy to reason about.
Mirror the core behaviors: deposits, withdrawals, role changes. Use asserts, fuzz tests and edge-case scenarios.
Run a Hardhat script to deploy to Sepolia, verify the contract, and use a block explorer to inspect state and events.
If you’re not sure where to begin, start here. These guides are the most universally useful across projects.
You can always come back later for the more niche topics like upgradeability or complex invariants.