← Protocols
Scaffold-ETH 2
01Description

Open-source, forkable full-stack toolkit for building dapps on Ethereum. Bundles Next.js + RainbowKit + wagmi + viem on the frontend with Hardhat or Foundry on the contract side, plus typed contract hooks and a Debug Contracts UI.

02Best for
  • 01rapid dapp prototyping
  • 02hackathons & demos
  • 03full-stack Solidity + Next.js
  • 04auto-generated typed hooks
  • 05local-first dev with Burner Wallet
03Install
  • npx create-eth@latest
  • yarn install && yarn chain && yarn deploy && yarn start
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_ALCHEMY_API_KEYClientAlchemy key used by the default RPC config.
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_IDClientWalletConnect Cloud project ID for RainbowKit.
DEPLOYER_PRIVATE_KEYServerDeployer key used by Hardhat/Foundry deploy scripts.
05Prompt snippet
Bootstrap a full-stack dapp with `npx create-eth@latest` and select Hardhat or Foundry when prompted. Three-terminal flow: `yarn chain` (local node), `yarn deploy` (compile + deploy with hot reload), `yarn start` (Next.js at :3000). Read on-chain state with the typed hook `useScaffoldReadContract({ contractName: "YourContract", functionName: "greeting" })` and write with `useScaffoldWriteContract`. Use the built-in `/debug` page to call any function. Add an extension at create time with `npx create-eth@latest -e <extension>` (e.g. `ponder`, `subgraph`, `erc-20`).
06Gotchas
  • Scaffold-ETH 2 is a yarn workspaces monorepo — using `npm install` at the root breaks resolution; stick to yarn (or pnpm with the right workspace config).
  • The Burner Wallet stores keys in localStorage and is for dev only — never enable it in production builds.
  • Typed contract hooks are generated from `deployedContracts.ts`; if you change a contract and forget `yarn deploy`, the frontend will reference a stale ABI.
  • Default `targetNetworks` in `scaffold.config.ts` includes `hardhat` — remove it before deploying to mainnet or users will see a chain-mismatch warning.
  • `create-eth` extensions can pin older RainbowKit/wagmi majors; bump versions deliberately and re-test wallet connection flows after upgrading.
07Alternatives