A viral, gasless Mini-App for Base App and Farcaster that runs a game-theoretic experiment where the last 100 people to send $1 (0.001 ETH) split the entire pot when a 42-minute countdown expires. Every transaction resets the timer. Pure chaos, maximum virality.
- Send $1 (0.001 ETH) to enter the game
- Every entry resets the 42-minute countdown
- Last 100 entries when timer expires split the entire pot
- Batch payout - all winners paid in a single transaction
- No gas fees - transactions sponsored by Base Paymaster
- Frontend: Next.js 14 + TypeScript + Tailwind CSS
- Blockchain: Base (Ethereum L2)
- Smart Contract: Solidity 0.8.20 + OpenZeppelin
- Wallet: OnchainKit MiniKit + Smart Wallet
- Gas Sponsorship: Coinbase Developer Platform Paymaster
``` SendOneOrNGMI/ βββ contracts/ β βββ SendOneOrNGMI.sol # Main game contract βββ src/ β βββ app/ β β βββ api/ β β β βββ paymaster/ # Paymaster proxy β β β βββ webhook/ # Farcaster webhooks β β βββ .well-known/ # Farcaster manifest β β βββ layout.tsx # Root layout β β βββ page.tsx # Main game page β β βββ globals.css # Global styles β βββ components/ β β βββ CountdownTimer.tsx # MM:SS countdown β β βββ PotStats.tsx # Pot value display β β βββ CTASection.tsx # Send $1 button β β βββ LiveQueue.tsx # Winner queue β β βββ BatchPayoutButton.tsx β β βββ EndGameButton.tsx β β βββ GameEndedBanner.tsx β βββ lib/ β β βββ contract.ts # Contract ABI & config β βββ providers/ β βββ MiniKitProvider.tsx βββ public/ # Static assets βββ .env.example # Environment template βββ package.json ```
```bash npm install ```
```bash cp .env.example .env.local ```
Edit `.env.local` with your values:
- `NEXT_PUBLIC_ONCHAINKIT_API_KEY` - Get from Coinbase Developer Platform
- `CDP_PAYMASTER_URL` - Paymaster endpoint from CDP
- `NEXT_PUBLIC_CONTRACT_ADDRESS` - Your deployed contract address
```bash npx create-onchain --manifest ```
```bash npm run dev ```
Visit http://localhost:3000
- 42-minute countdown (resets on each entry)
- Circular queue of 100 addresses
- Batch payout - all winners paid in one transaction
- ReentrancyGuard protection
- Pausable for emergencies
```bash
curl -L https://foundry.paradigm.xyz | bash foundryup
forge install foundry-rs/forge-std forge install OpenZeppelin/openzeppelin-contracts
forge build
forge test -vvv ```
```bash
cp .env.foundry.example .env
source .env
forge script contracts/script/Deploy.s.sol:DeploySendOneOrNGMI \ --rpc-url $BASE_SEPOLIA_RPC_URL \ --private-key $PRIVATE_KEY \ --broadcast \ --verify
forge script contracts/script/Deploy.s.sol:DeploySendOneOrNGMI \ --rpc-url $BASE_RPC_URL \ --private-key $PRIVATE_KEY \ --broadcast \ --verify ```
```bash
forge test
forge test -vvv
forge test --match-test test_SendOne_StartsGame
forge test --gas-report ```
```bash forge verify-contract YOUR_CONTRACT_ADDRESS \ contracts/SendOneOrNGMI.sol:SendOneOrNGMI \ --chain base \ --etherscan-api-key $BASESCAN_API_KEY ```
- Go to Coinbase Developer Platform
- Create a new project
- Enable Paymaster
- Add your contract address to the allowlist
- Add `sendOne()` function to allowed functions
- Set spending limits:
- Per-user: $0.10/day
- Global: $500/week
```bash npm run dev
Visit http://localhost:3000
```
Test your Mini-App at: https://warpcast.com/~/developers/mini-apps
```bash npm run test ```
```bash vercel ```
Add all variables from `.env.example` to your Vercel project settings.
| Metric | Value |
|---|---|
| Entry Fee | 0.001 ETH (~$2.50) |
| Countdown | 42 minutes |
| Winners | Last 100 entries |
| Payout | Batch (single tx) |
| Gas | Sponsored (free) |
- β ReentrancyGuard on all state-changing functions
- β Batch payout pattern (no individual withdrawals)
- β Paymaster proxy to hide URL
- β Contract allowlist in CDP
- β Per-user and global spending limits
- β Pause mechanism for emergencies
- Base App (clientFid: 309857)
- Warpcast (clientFid: 9152)
- Farcaster (clientFid: 1)
- Web (standalone)
| Element | Value |
|---|---|
| Background | #000000 (black) |
| Primary | #10B981 (green-500) |
| Accent | #059669 (green-600) |
| Warning | #EF4444 (red-500) |
| Text | #FFFFFF, #9CA3AF |
MIT
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Built with π for Base App & Farcaster
LFG! π