@greyw0rks/celotip
v0.1.0
Published
Community tipping dApp on Celo, compatible with MiniPay. Send USDm tips to community members with on-chain leaderboard.
Maintainers
Readme
CeloTip 💸
A community tipping dApp on Celo, fully compatible with MiniPay.
Send cUSD tips to community members, see a live leaderboard of top givers and receivers, and leave shoutout messages — all on-chain.
Features
- ⚡ MiniPay auto-connect — detects MiniPay environment and connects instantly
- 💚 cUSD tipping — send Celo's native stablecoin to any address
- 🏆 Live leaderboard — top tippers and most-tipped members
- 📜 On-chain feed — every tip stored and queryable from the contract
- 📱 Mobile-first UI — designed for MiniPay's screen size
Quick Start
1. Install dependencies
npm install2. Deploy the contract
# Install hardhat deps
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox dotenv
# Set your private key
echo "PRIVATE_KEY=0x..." > .env
# Deploy to Celo mainnet
npx hardhat run scripts/deploy.ts --network celoCopy the deployed address into lib/constants.ts:
export const CELOTIP_ADDRESS = "0xYourDeployedAddress" as const;3. Run the app
npm run devOpen http://localhost:3000 with a browser that has a Celo wallet (or open in MiniPay).
MiniPay Compatibility
The useMiniPay hook (hooks/useMiniPay.ts) handles everything:
- Detects
window.ethereum.isMiniPay - Auto-connects without a wallet modal
- Reads cUSD balance from Celo mainnet
- Enforces chain ID 42220
Proof of Ship Checklist
- [x] MiniPay hook (
useMiniPay.ts) added - [x] App compatible with MiniPay (auto-connect, cUSD, mobile UI)
- [ ] Deploy
CeloTip.solon Celo mainnet → paste address inconstants.ts - [ ] Verify humanity (Self / Worldcoin / Coinbase)
- [ ] Submit project to campaign
Contract
CeloTip.sol — peer-to-peer cUSD tipping with on-chain event log.
| Function | Description |
|---|---|
| tip(recipient, amount, message) | Send cUSD tip + emit event |
| getRecentTips(offset, limit) | Paginated tip history |
| totalSent[address] | Total cUSD sent by address |
| totalReceived[address] | Total cUSD received by address |
Project Structure
celotip/
├── app/
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Main page
│ ├── providers.tsx # wagmi + react-query
│ └── globals.css
├── components/
│ ├── SendTipModal.tsx # Tip form bottom sheet
│ └── Leaderboard.tsx # Feed + rankings
├── contracts/
│ └── CeloTip.sol # Solidity contract
├── hooks/
│ ├── useMiniPay.ts # ⚡ MiniPay integration hook
│ └── useTipping.ts # Tip flow (approve + send)
├── lib/
│ └── constants.ts # Addresses + ABIs
└── scripts/
└── deploy.ts # Hardhat deploy script