CritterHoles on Celo is a blockchain-based casual game built on Celo Mainnet, where players whack critters, earn points, and claim on-chain rewards.
The game uses React + TypeScript + Vite with Reown AppKit, wagmi, and a Cloudflare backend for claim verification.
- Hit critters as they pop up before time runs out.
- Each critter type gives different scores based on rarity:
| Critter | Image | Points | Rarity |
|---|---|---|---|
| ๐น Mole | ![]() |
1 | Common |
| ๐ฆจ Skunk | ![]() |
2 | Uncommon |
| ๐ Rabbit | ![]() |
3 | Rare |
You must own a Hammer NFT to play. Mint one on the Mint Page using the mint() function in the Celo contract.
- After the game ends, scores are converted into
$CHPtokens. - Random rewards include
$ETHIXor$GoodDollar. - Players have a daily claim limit, read from the contract.
- Claims are verified through a Cloudflare Function at
/api/claim.
$CHPโ main in-game point token.$ETHIXand$GoodDollarโ bonus tokens randomly distributed.- Smart contracts are managed in the Hardhat repository.
| Layer | Description |
|---|---|
| Frontend | React 19 + TypeScript + Vite 7 |
| Blockchain | Celo Mainnet |
| Wallet Integration | Reown AppKit + wagmi + viem |
| Backend | Cloudflare Functions (/functions/claim.ts) |
| UI Framework | TailwindCSS + Framer Motion |
| MiniApp | Farcaster integration |
git clone https://github.com/hihenluo/Critterholes.git
cd Critterholesnpm installIn the functions/ directory, create an .env file:
SIGNER_PRIVATE_KEY=your_private_key
ETHIX_TOKEN_ADDRESS=your_ethix_token_address
G_TOKEN_ADDRESS=your_gooddollar_token_address
CELO_RPC_URL=https://forno.celo.orgThese variables are used by the Cloudflare Function
/api/claimto sign reward claims and interact with Celo smart contracts.
npm run devnpm run buildnpm run previewHandles reward claiming logic:
- Validates connected wallet and score.
- Generates and returns claim signature (
v,r,s,databytes). - Interacts with Celo contracts to confirm reward eligibility.
Deploy to Cloudflare with:
npx wrangler deploy- Player connects wallet using Reown.
- System checks Hammer NFT ownership.
- If missing, mint one before playing.
- During the game, player earns points.
- After game ends, claim reward via
/api/claim. - Backend signs transaction and executes
claim()on-chain.
- ๐ฎ Main Game Repo
- ๐ป Smart Contract Repo (Hardhat)
- ๐ Celo Network
- ๐ Reown AppKit
- ๐ Cloudflare Pages
Licensed under the MIT License
on Celo Mainnet โข Powered by Reown & Farcaster


