Skip to content

Repository files navigation

Scaffold-HBAR

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.

Create a project

npm create scaffold-hbar@latest

npx create-scaffold-hbar@latest is equivalent. The CLI fetches starter templates from this repo's templates/* branches.

Work from this repository

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.

Prerequisites

  • Node.js ≥ 20.18.3
  • Git with user.name and user.email configured
  • 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)

Quick start

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:start

Open 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.

Project layout

  • 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.

Links

About

Open source forkable Hedera dev stack

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages