Crypto Launch Kit
Docs/DAO Governance

DAO Governance

Proposals, voting and a timelock treasury — on chain

View the DAO Governance template →

Overview

A governance portal on the audited OpenZeppelin Governor stack: create proposals, delegate and vote with your token, watch quorum and tallies, and run a timelock-controlled treasury. An optional fixed-price token sale can seed the treasury.

DAO Governance gives your community a real portal: a list of proposals with their state, quorum progress and for/against/abstain tallies, a one-click vote (after delegating), your live voting power, the treasury balance, and a form to create a signal proposal — all read from on-chain governance events.

It's built on the OpenZeppelin Governor stack: an ERC20Votes governance token, a TimelockController that holds the treasury and executes passed proposals after a delay, and a Governor with configurable voting delay, period, quorum and proposal threshold. The multi-step wizard deploys the timelock and governor and wires the roles correctly (proposer/executor granted, deployer admin renounced).

An optional GovSale contract lets you sell an allocation of governance tokens at a fixed price, sending the proceeds straight to the treasury — a simple way to bootstrap funds and distribute votes.

What's included

  • Next.js app (App Router, TypeScript, Tailwind)
  • GovToken + TimelockController + MyGovernor (+ optional GovSale) — Hardhat
  • Multi-step deploy wizard that wires the timelock & governor roles
  • Dockerfile + docker-compose
  • README + .env workflow

Smart contracts

  • GovToken.sol — ERC-20 governance token with on-chain voting power and gasless approvals; holders delegate (to themselves or a delegate) to activate their votes (OpenZeppelin ERC20Votes + ERC20Permit).
  • TimelockController — OpenZeppelin timelock that holds the DAO treasury and executes passed proposals after a configurable delay.
  • MyGovernor.sol — OpenZeppelin Governor (settings + simple counting + token votes + quorum fraction + timelock control): proposals are created, voted on, queued through the timelock and executed.
  • GovSale.sol — an optional fixed-price sale of an allocation of gov tokens; the native-coin proceeds go straight to the treasury (OpenZeppelin Ownable).

Tech stack & chains

Built with Next.js, TypeScript, Tailwind, viem, OpenZeppelin Governor, Hardhat.

Runs on: Ethereum, BSC, Polygon, any EVM. The chain is a configuration value — point it at any EVM network or a testnet like Sepolia.

Quick start

After purchase you get a zip of the full source. Unzip it, then install dependencies and start the dev server:

unzip dao-governance.zip && cd dao-governance
npm install
npm run dev

The app starts on http://localhost:3005. On first run — before any .env exists — it boots straight into the setup wizard instead of the real app.

Configure with the setup wizard

The wizard collects everything the template needs and writes a .env for you — no hand-editing required to get started.

  1. Pick the network and (optionally) a read-only RPC URL — test it with the built-in button.
  2. Choose theme, accent color and font.
  3. Fill in your token / project details and parameters.
  4. Deploy the included smart contract(s) straight from your browser wallet (MetaMask). If you set an Etherscan API key, the source is auto-verified.
  5. Click View .env, copy or download the file, save it as .env in the project root, and restart the dev server.
Tip · Prefer the command line? Every deploy step has a CLI equivalent (npm run compile && npm run deploy). The wizard just makes the happy path clickable.

Once a valid .env is present the wizard disappears and the live app renders. Re-running the wizard later is as simple as removing the required values again.

Customize

Branding & content (no code)

Almost everything visible — name, symbol, taglines, descriptions, caps, dates, social links — is an environment variable in .env. Edit the value and restart; the wizard documents each one with a comment.

Appearance is env-driven too: NEXT_PUBLIC_THEME (dark / light / system), NEXT_PUBLIC_ACCENT (any hex color) and NEXT_PUBLIC_FONT. Some fields aren't asked in the wizard on purpose — you'll find them in .env with sensible defaults and can edit them directly.

Languages

The UI ships translated into 10 languages under messages/*.json (en, es, fr, zh, hi, ar, pt, bn, ru, ja). Edit a value to change wording, or add a key — missing keys fall back to English.

Editing the UI

The interface is a small set of React components under components/ styled with Tailwind. The main screen is a single component you can freely edit. On-chain reads are batched through a shared lib/web3.ts helper, so adding a new stat is a one-line read.

Configuration reference

Configuration lives in .env (copy .env.example to start, or let the wizard generate it). Two kinds of variables:

  • NEXT_PUBLIC_* — read in the browser (token name, addresses, theme, RPC). These are inlined at build time, so set them before you build for production.
  • Server-only values (deploy keys, private RPC) — never prefixed with NEXT_PUBLIC_, never shipped to the client.
Tip · Never commit a real .env or a private key. .env is git-ignored; the deploy key is only used locally by Hardhat.

Deploy the smart contracts

You have two equivalent options. In the browser, the setup wizard's deploy step sends the deploy transaction from your wallet and (with an Etherscan key) verifies the source automatically. From the CLI:

# compile + copy artifacts the app/wizard use
npm run compile

# deploy to the network in your .env (RPC_URL + DEPLOYER_PRIVATE_KEY)
npm run deploy

Copy the printed contract address into the matching NEXT_PUBLIC_* address variable (the wizard does this for you). Auto-verification retries while the explorer indexes the new contract, so a fresh deploy verifies within a minute or so.

Deploy the app

Vercel (or any Next.js host)

  1. Push the project to a Git repo and import it in Vercel.
  2. Add your .env values as Environment Variables (remember NEXT_PUBLIC_* are baked at build time, so set them before the build).
  3. Deploy. Next.js App Router is fully supported out of the box.

Docker (single template)

Each template ships a multi-stage Dockerfile that produces a tiny distroless runtime (just Node.js + the standalone build — no shell or package manager) and a docker-compose.yml:

# build + run; with no .env it opens the setup wizard
docker compose up --build

# once you have a .env, pass it in:
docker run --env-file .env -p 3005:3000 dao-governance

The container serves on port 3000 internally; the compose file maps it to 3005 on your host. Build-time NEXT_PUBLIC_* values can be passed as build args or baked from a committed .env.

VPS / bare metal

Build once and run the Node server — no Docker required:

npm install
npm run build
npm run start   # serves the production build

Production checklist

  • Set NEXT_PUBLIC_CHAIN_ID to your real chain (mainnet/BNB/Polygon) — not a testnet.
  • Use a dedicated RPC endpoint (Infura/Alchemy/your node) in NEXT_PUBLIC_RPC_URL for reliable reads.
  • Deploy and verify your contract on the explorer so users can read the source.
  • Double-check economic parameters (caps, price, supply, dates) — they're immutable once deployed.
  • Set the real NEXT_PUBLIC_* values at build time, and keep server secrets out of the client.

Support

Each template includes a README with the same steps, an .env.example, and inline comments. Questions about your purchase are answered from the store.