A pixel art arcade game built as a Farcaster Mini App on Base, featuring solo and versus modes with on-chain achievement NFTs.
Tap That Mosquito is a fast-paced tapping game where players score points by eliminating mosquitoes before they escape. Supports wallet integration for leaderboard tracking, achievement NFTs, and a competitive versus mode with on-chain battles.
- Fun and Addictive: Simple mechanics with combo system for competitive gameplay
- On-Chain Achievements: Mint ERC-721 NFTs based on your score tier
- Versus Mode: Challenge friends to 1v1 battles with winner-takes-all NFT rewards
- Farcaster Native: Built as a Mini App for seamless integration with Farcaster ecosystem
- 60-second timed gameplay with progressive difficulty
- Swarm Events: Random bursts of insects with hazards
- Elite Mosquitoes: Armored (2-tap), Healer (speed buff), Blink (teleport)
- Combo Multiplier: 5 taps = 2x, 10 taps = 3x points
- Hazard System: Avoid bees (-50 pts) and skulls (-100 pts)
- Five achievement tiers: Common, Uncommon, Rare, Epic, Legendary
- Global leaderboard with Farcaster username integration
- Sound effects and pixel art aesthetics
- Create and accept challenges via smart contract
- Victory NFTs for battle winners
- Champion NFT after 5 wins
- Win streak tracking
- Challenge by @username, fid:1234, or 0x address
- Optional notification opt-in for challenge alerts
- Open-source Solidity contracts with OpenZeppelin base
- Trusted Signer Oracle: ECDSA signature verification for game results
- On-chain SVG generation for NFT metadata
- Vite development environment
- Farcaster SDK integration
- Paymaster-sponsored minting via
wallet_sendCallswith fallback paths
| Feature | Description |
|---|---|
| Swarm Events | 3 waves at 12s, 28s, 45s with escalating difficulty |
| Bee Hazard | Tap = -50 pts, Avoid = +20 pts |
| Skull Hazard | Tap = -100 pts, Avoid = +30 pts |
| Combo Multiplier | Build up to 3x points with consecutive taps |
| Strategic Depth | Balance speed vs. accuracy during swarm chaos |
Share your score β Get rewards in next game:
- +5 seconds bonus time
- 2x multiplier from the start
- Hazard immunity (first hazard blocked)
Invite friends via your unique link:
- Referral code based on Farcaster username (no
@) - Friend opens
/?ref=usernamelink β Both get boosts:- +10 seconds bonus time
- +50 starting points
- 2x multiplier start
- Boosts can stack!
-
MosquitoSlayerNFT Achievement NFTs with five tiers based on player scores. Fully on-chain SVG artwork.
-
VersusNFT Challenge system with 1v1 battles. Victory NFTs for winners and Champion NFTs for 5+ wins.
tap-that-mosquito/
βββ contracts/
β βββ MosquitoSlayerNFT.sol # Achievement NFTs
β βββ VersusNFT.sol # Versus mode battles
β βββ PrizePool.sol # Sponsor-funded rewards
βββ api/ # Serverless endpoints (signing, leaderboard, notifications)
βββ game.js # Main game logic
βββ nftMinter.js # NFT minting integration
βββ onchainkit.jsx # OnchainKit wallet + transaction UI
βββ baseAccount.js # Base Account SDK provider
βββ versusContract.js # Versus mode integration
βββ leaderboard.js # Score tracking
βββ sponsorManager.js # Prize pool + sponsor tiers
βββ referralManager.js # Referral tracking
βββ shareManager.js # Share-to-boost flow
βββ index.html # Game UI
βββ style.css # Pixel art styling
βββ supabaseClient.js # Supabase client setup
βββ scripts/ # Deploy + admin scripts
βββ public/ # Assets and manifest
- Wallet connection via ethers.js
- Farcaster Mini App SDK for context and actions
- Local and on-chain leaderboard tracking
- Real-time combo indicator and sound effects
| Contract Name | Description |
|---|---|
| MosquitoSlayerNFT | Achievement NFTs with tier-based scoring |
| VersusNFT | 1v1 challenge and victory tracking |
| PrizePool | Sponsor-funded USDC rewards + sponsor NFTs |
- Network: Base Mainnet
- Solidity Version: 0.8.20
- OpenZeppelin: 5.4.0
- Framework: Hardhat
- Addresses: Update
contract.js,versusContract.js, andVITE_PRIZE_POOL_ADDRESSafter deploys.
| Contract | Base Mainnet | Base Sepolia |
|---|---|---|
| MosquitoSlayerNFT | 0xB7f6D7456837555D7A983f95982cBdb34F102897 |
0x0cb3B5B40491F9c1b5f62Eb1094eF4BAE518a464 |
| VersusNFT | 0x58fA308a7AE80A1bAe56b33183C78B7de092BBf6 |
0x0F48Fd7aAC0A3e4FE75029b618b32a66266666B5 |
- 2026-01-16: VersusNFT redeployed on Base mainnet to snapshot win streak per battle (
battleWinStreak). New address:0x58fA308a7AE80A1bAe56b33183C78B7de092BBf6.
| Function | Description |
|---|---|
mintAchievement(tier, score, nonce, signature) |
Mint NFT with backend signature verification |
getTierFromScore(score) |
Get tier based on score |
getClaimableTiers(player, score) |
Check which tiers player can claim |
setTrustedSigner(address) |
Admin: update signer address |
generateSVG(tokenId) |
Get on-chain SVG artwork |
tokenURI(tokenId) |
Get full token metadata |
| Function | Description |
|---|---|
createChallenge(opponent) |
Create a new 1v1 challenge |
acceptChallenge(challengeId) |
Accept a pending challenge |
cancelChallenge(challengeId) |
Cancel a pending challenge |
finalizeBattle(..., signature) |
Submit battle results with backend signature |
mintVictoryNFT(battleId) |
Mint victory NFT as winner |
setTrustedSigner(address) |
Admin: update signer address |
mintChampionNFT() |
Mint champion NFT after 5 wins |
| Function | Description |
|---|---|
deposit(amount) |
Sponsor the pool in USDC (min $3) |
distribute(week, winners, nonce, signature) |
Signed weekly distribution to top 10 |
hasBoostPerk(address) |
Silver+ boost eligibility |
canMintSponsorNFT(address) |
Gold+ sponsor NFT eligibility |
mintSponsorNFT() |
Mint sponsor NFT (Gold+ only) |
setTrustedSigner(address) |
Admin: update signer address |
- MetaMask and other injected wallets
- EIP-1193 provider detection
- Context detection for Mini App environment
- Ready signal for frame loading
- Share actions for social integration
- Quick Auth for seamless Base app wallet access
- Optional notification opt-in for challenge alerts
- Node.js 18+
- MetaMask or compatible wallet
- Base Mainnet ETH for gas
# Install dependencies
npm install
# Run development server
npm run dev
# Opens at http://localhost:5173
# Build for production
npm run build# Compile contracts
npx hardhat compile
# Deploy to Base Mainnet
npx hardhat run scripts/deploy.cjs --network baseMainnet
# Deploy all contracts (NFT + PrizePool + Versus)
npx hardhat run scripts/deploy-mainnet-all.cjs --network baseMainnet
# Update trusted signer without redeploy
npx hardhat run scripts/update-nft-signer.cjs --network baseMainnetCreate a .env with the values you need for your environment:
# Deployment + verification
PRIVATE_KEY=0x...
BASESCAN_API_KEY=...
SIGNER_PRIVATE_KEY=0x...
SIGNER_ADDRESS=0x...
# App config
VITE_PRIZE_POOL_ADDRESS=0x...
VITE_NFT_CONTRACT_ADDRESS=0x...
VITE_PAYMASTER_URL=https://api.developer.coinbase.com/rpc/v1/base/...
VITE_SUPABASE_URL=...
VITE_SUPABASE_ANON_KEY=...
NEYNAR_API_KEY=...- HTML5
- Vanilla JavaScript (ES Modules)
- CSS3 with pixel art fonts
- Vite bundler
- Solidity 0.8.20
- OpenZeppelin Contracts 5.4.0
- Hardhat
- ethers.js
- Farcaster Mini App SDK
- Base Mainnet
- OnchainKit (wallet UI, transactions, identity)
- Base Account SDK (smart wallet connection)
- Pixel art game mechanics
- Combo system
- Sound effects
- Local score tracking
- MetaMask connection
- Leaderboard with addresses
- Farcaster username lookup
- MosquitoSlayerNFT contract
- Five achievement tiers
- On-chain SVG generation
- Mint button integration
- VersusNFT contract
- Challenge creation and acceptance
- Victory NFT minting
- Champion NFT system
- Trusted Signer Oracle for score verification
- ECDSA signature validation on contracts
- Swarm events with progressive difficulty
- Hazard system (bees and skulls)
- Combo multiplier (2x/3x) system
- Avoidance rewards for strategic play
- Share-to-Boost rewards system
- Referral code generation from wallet
- URL parameter tracking (?ref=CODE)
- Stackable boost rewards
- Referral link in all shares
- PrizePool smart contract with USDC
- Sponsor tiers: Bronze $3, Silver $5, Gold $10, Diamond $20
- 90% weekly distribution, 10% rollover
- Signed distribution with trusted signer
- Sponsor NFT for Gold+ donors
- Permanent game boosts for Silver+ sponsors
- Wallet-gated homepage (game hidden until connected)
- Neon Arcade UI revamp with premium buttons
- Leaderboard modal accessible from homepage
- VersusNFT deployed to Base Mainnet
- Challenge expiration (7-day timeout)
- Username sanitization and leaderboard deduplication
- Normalized wallet address matching
- Improved referral system (username-only codes)
- FID-based notification token storage
- Full Farcaster-based challenge system (create, accept, decline)
- FID and username-based opponent lookup
- Challenge notification opt-in button
- Revamped Challenge Modal with glassmorphism design
- Polished notification status messages
- Elite Mosquitoes: Armored (2-tap, +25 pts), Healer (+20% speed buff), Blink (teleport)
- Faster spawn rates (1000ms base, 320ms min)
- Progressive difficulty with extra spawn chances
- Increased swarm counts (7/12/18 per level)
- Improved NFT minting with on-chain tier checks
- Wallet provider improvements with timeout handling
- Paymaster-sponsored minting with
wallet_sendCallsfallback - OnchainKit wallet and transaction components
- Base Account SDK integration for seamless wallet connection
- Identity card display for connected players
- Unified wallet provider management across game and minter
- Daily Jackpot mode with ETH entry fees
- Streak NFTs for consecutive play
- Sponsor Bounty Board
Sponsors deposit USDC to fund weekly rewards for top players.
| Tier | Deposit | Perks |
|---|---|---|
| π₯ Bronze | $3 USDC | Name on Sponsor Wall |
| π₯ Silver | $5 USDC | + Permanent game boosts (+10s, 2x) |
| π₯ Gold | $10 USDC | + Exclusive Sponsor NFT |
| π Diamond | $20 USDC | + Featured in winner casts |
| Rank | % of Pool |
|---|---|
| #1 | 30% |
| #2 | 20% |
| #3 | 12% |
| #4 | 8% |
| #5 | 6% |
| #6 | 5% |
| #7 | 4% |
| #8 | 3% |
| #9 | 1% |
| #10 | 1% |
| Rollover | 10% (remains in pool) |
Contributions are welcome. Please fork the repository and submit a pull request.
MIT License
- OpenZeppelin for secure contract libraries
- Farcaster for Mini App ecosystem
- Base for L2 infrastructure
- Press Start 2P font for pixel art aesthetics