example-locker-dapp

Installation
SKILL.md

Midnight Network Locker DApp

A locker dApp holds unshielded NIGHT in a Compact contract until unlockTime (Unix seconds, Uint<64>). No one — including the deployer — can withdraw early. After the deadline, only the beneficiary (proven via witness) can call release and send tokens to a recipient address.

Runnable template: Copy templates/locker-dapp/ for a complete Next.js project (contract + UI). Run npm install && npm run compact && npm run dev after installing the 1AM wallet.

What this skill produces:

  • contract/ — Compact locker vault + TypeScript witnesses + compile scripts
  • app/locker/ — Next.js client UI (connect, deploy, lock, release, status)
  • lib/midnight.ts — wallet session + patched indexer provider (copy from references/midnight-session.md or templates/locker-dapp/lib/midnight.ts)
  • lib/locker.ts — deploy, lockTokens, release, ledger decode
  • public/zk/locker/ — ZK proving assets synced from contract build

Shared references (canonical provider + troubleshooting — do not duplicate in prompts):

  • references/midnight-session.mdcreateConnectedSession, indexer patch, deploy/call helpers
  • references/gotchas.md — preprod deploy hangs, GraphQL offset: null, ZK asset paths
  • references/versions.json — pinned @midnight-ntwrk/* versions
Installs
113
GitHub Stars
16
First Seen
Jul 2, 2026
example-locker-dapp — kali-decoder/midnight-skills