A Hedera-ready monorepo for building dApps with Next.js, Hardhat or Foundry, and Hedera networks (testnet, mainnet, local fork).
The full product guide — templates, CLI flags, npm vs Yarn, deploy, and verify — lives in Scaffold HBAR on Hedera docs. This README is for people landing on the repo: create a project, or clone main and run it.
npm create scaffold-hbar@latestnpx create-scaffold-hbar@latest is equivalent. The CLI fetches starter templates from this repo's templates/* branches.
main is the forkable baseline. Clone-and-run uses Yarn workspaces. Apps created with the CLI can use Yarn (default) or npm; see the docs.
- Node.js ≥ 20.18.3
- Git with
user.nameanduser.emailconfigured - Yarn (default; required if you clone this repo) or npm if you scaffolded with the CLI. For Yarn, install via Corepack:
corepack enable && corepack prepare yarn@stable --activate
- If using Foundry: Foundry (
forge,cast,anvil)
yarn install
# Terminal 1: local Hedera-forked node
yarn hardhat:chain
# Terminal 2: deploy to that node (8545)
yarn hardhat:deploy --network localhost
# Terminal 3: Next.js app
yarn next:startOpen http://localhost:3000 and use the Debug Contracts page.
yarn hardhat:deploy without --network localhost targets the in-process hardhat network, not the long-running fork. Local Hardhat and Foundry workflows are in packages/hardhat/README.md and packages/foundry/README.md. Deploy and verify on testnet/mainnet: Hedera docs.
- packages/hardhat — Hardhat config, contracts,
deploy/scripts, tests - packages/foundry — Forge config, contracts,
script/deploy scripts, tests - packages/nextjs — Next.js app, RainbowKit, wagmi, scaffold config
Network and RPC URLs are in packages/hardhat/hardhat.config.ts and packages/foundry/foundry.toml respectively.