A Farcaster Mini App for buying and gifting Megapot lottery tickets on Base — straight from your feed. 1 USDC per ticket, daily drawings, real prizes.
Live: https://farpot.vercel.app
Farpot is an independent community front-end. It is not affiliated with or endorsed by Megapot — it's powered by Megapot's public, permissionless on-chain lottery contracts. "Megapot" is a trademark of its respective owner; used here for descriptive attribution only.
- 🎰 Buy Megapot tickets in-app — pick your own 5 + bonusball, or quick-pick
- 🎁 Gift a ticket to any Farcaster user by
@username(resolves their verified Base address via Neynar) - 🏆 Results tab — past drawings + your own ticket history, with in-app claim winnings
- 📣 Share-to-cast after a buy, plus optional post-draw "check your results" notifications
- 🟣 Signed Farcaster manifest — renders as a Mini App embed in Farcaster clients
- ⚡ USDC
approve→ buy flow via wagmi + viem on Base
- Next.js 16 (App Router)
- OnchainKit + MiniKit
- wagmi / viem
- Farcaster Mini App SDK
- Neynar for
@username→ address resolution
npm install
cp .env.example .env.local # then fill in the values
npm run devOpen http://localhost:3000.
See .env.example. The app runs against public Base RPCs out
of the box; an OnchainKit API key and a
Neynar key unlock wallet RPC and gift-by-handle lookup.
Nothing secret is committed — .env* is gitignored.
Contract addresses, ABIs, and the referral wallet live in
src/lib/constants.ts — the single source of truth.
The flow is always USDC approve → buyTickets.
- Deploy to Vercel and set the env vars (set
NEXT_PUBLIC_URLto your final domain). - Re-sign the manifest for your domain. The
accountAssociationinsrc/lib/minikit.config.tsis bound tofarpot.vercel.appand signed by the original author's Farcaster account — it will not validate on your domain. Regenerate it with the Farcaster Manifest Tool and replace those three values. - The
REFERRAL_WALLETinconstants.tsearns the protocol's 10% referral fee on each sale. Point it at your own address if you deploy your own instance.
MIT © ren2140eth