Skip to main content
Use this guide when you want a Next.js dApp that connects wallets via WalletConnect (e.g. MetaMask Mobile QR), uses WAGMI and Viem, and deploys a contract from the browser.

Repository

Requirements

  • Node v20.11.0, npm
  • WalletConnect Project ID — set in .env as NEXT_PUBLIC_PROJECT_ID
  • MetaMask Mobile (or other WalletConnect-compatible wallet) for QR flow

Stack

Next.js 14, TypeScript, WalletConnect, WAGMI, Viem.

Quick start

  1. Clone and install
    Add NEXT_PUBLIC_PROJECT_ID from WalletConnect Cloud.
  2. Run
  3. In the app: Connect WalletWalletConnect → scan QR with MetaMask Mobile. Enter a greeting and click Deploy to deploy the contract; confirm in MetaMask.
For RPC and chain config, see Berachain docs.

Key files