Beginner

Intro to Hardhat / Foundry — Hands-on

Learn the dev workflow.

Developer Beginner
5/7 — Intro to Hardhat / Foundry — Hands-on

GoalGet a full loop running: compile, test, deploy, verify—all from the CLI.

The root problem with conventional currency is all the trust that’s required to make it work.
— Satoshi Nakamoto
Steps
  1. Initialize Hardhat (npm init:-y && npx hardhat) or Foundry (forge init) in a fresh folder.
  2. Add a simple contract:(Counter.sol) and compile.
  3. Write a basic test:That deploys and increments; run tests.
  4. Write a deploy script:That prints the address; run against a testnet with env secrets.
  5. Optional:Enable a fork (e.g., mainnet via Alchemy/Infura) and run your test against the fork to see real state.
  6. Verify the deployed contract:Via the framework’s verify task/plugin.
← Previous section
Next section →