Skip to main content
Use this guide when you want to set up Hardhat with Viem for Berachain, deploy a simple contract, verify it on the block explorer, and optionally run a local Hardhat node and tests.

Repository

Requirements

Stack

Hardhat, Viem, Solidity, TypeScript.

Quick start

  1. Clone and install
    Set WALLET_PRIVATE_KEY in .env.
  2. Compile and deploy to Berachain testnet
    (Uses scripts/deploy.ts and network berachainTestnet.)
  3. Verify on block explorer
  4. Optional — local node: npm run node in one terminal, then npm run deploy:localhost in another.
  5. Run tests: npm run test

Key files