A standalone lightweight miniapp that lets users vote on how they feel — either "Happy" 😊 or "Sad" 😢 — once every 24 hours. Built for the Monad and other EVM blockchains using a Solidity smart contract.
- Two voting buttons: "I'm Happy" and "I'm Sad"
- Users can only vote once per 24 hours (on-chain enforcement)
- Real-time stats: happy/sad percentages and totals
- Leaderboard (where enabled)
- Multi-network support + network selector (Monad + other EVM networks)
- Wallet support: MetaMask + WalletConnect (Reown/AppKit)
- Read-only mode (view stats/leaderboard without wallet connection)
- Optional gas refund feature (owner-controlled)
- Dark/Light theme toggle with persistence
- Built with React + Vite + Ethers.js + Wagmi/Viem
- Security hardening pass (dependency audit + config)
- Added
.env.exampleand moved provider/RPC URLs out of source where possible - Added Vercel security headers (
X-Content-Type-Options,Referrer-Policy,Permissions-Policy,X-Frame-Options) - Added dependency pinning via
overridesto mitigate known advisories (e.g.form-data,axios)
- Added
- Test stability
- Added minimal Jest test and a
TextEncoder/TextDecoderpolyfill for CRA/JSDOM
- Added minimal Jest test and a
- Tooling
- Migrated build tooling to Vite (
npm run dev,npm run build,npm run preview)
- Migrated build tooling to Vite (
- Added support for Arc test network
- Contract verified
- Added support for Base network
- Contract verified
- Added support for Ethereum and Sepolia networks
- Contracts verified
- The updated contract for the testnet has been deployed after the Monad Testnet Re-Genesis.
- The
VotesInitializedfunction has been added to the contract to transfer the number of votes from the snapshot (the function can only be called over and only once). - Votes transferred to the new contract
- Gas Refund Feature: Optional gas fee reimbursement for voting transactions
- Automatically enabled/disabled by contract owner
- Visual badge indicator when refund is active
- Tooltip with detailed explanation
- Works for both Happy and Sad votes
- Optimized Gas Limits: Improved transaction success rate for both MetaMask and WalletConnect
- Enhanced Transaction Handling:
- Better error handling for user-rejected transactions
- Prevents duplicate transactions on cancellation
- Improved logging for debugging
- Wallet Type Detection: Fixed wallet type detection to correctly identify MetaMask vs WalletConnect connections
-
RPC Endpoint Protection:
- Whitelist validation for RPC endpoints to prevent endpoint substitution attacks
- Only allows HTTPS connections to authorized Monad RPC servers
- Validates all RPC URLs before creating network clients
-
XSS Prevention:
- All user-facing messages are sanitized to prevent cross-site scripting attacks
- Removes HTML tags, JavaScript protocols, and event handlers from error messages
- Message length limits to prevent DoS attacks
-
ABI Validation:
- Validates ABI structure before contract interactions to prevent malicious ABI injection
- Ensures only valid contract interfaces are used for read/write operations
- Protects against corrupted or malicious ABI data
-
Timer Protection:
- Validates and bounds timer values to prevent timer manipulation attacks
- Limits timer duration to reasonable ranges (0 to 1 year)
- Prevents negative or excessive timer values
-
DOM Security:
- Validates all DOM selectors and elements before manipulation
- Checks element types and node types to prevent DOM-based attacks
- Validates querySelector results and element properties before use
- Network selector: Choose between Monad Mainnet and Testnet with visual network badges
- Leaderboard: Top 10 happy voters leaderboard on mainnet with scrollable list
- Read-only mode: View voting results and leaderboard without wallet connection
- Redesigned controls: Compact floating control panel in top-right corner with:
- Network selector with custom dropdown and network icons
- Unified Connect Wallet button (opens WalletConnect modal)
- Theme toggle button
- All buttons in consistent style with equal height
- Mobile optimization: Fully responsive design with optimized spacing and compact controls
- App description: Added descriptive text under the main title
- Improved UX: Voting buttons and statistics visible without wallet connection; connection required only for voting/donating
- Monad mainnet & testnet support
- Dark/Light theme toggle 🌙☀️
- WalletConnect integration
- Light Theme: Clean, modern design with light colors
- Dark Theme: Dark background with high contrast for better night viewing
- Auto-detection: Automatically detects system theme preference
- Persistent: Theme choice is saved in localStorage
- MetaMask: Direct browser extension connection
- WalletConnect: Mobile wallet support via QR code (300+ wallets supported)
- Network switching: Automatic Monad Testnet detection and switching
- Multi-wallet support: Choose between MetaMask and WalletConnect
- Mobile-friendly: WalletConnect enables mobile wallet connections
Mainnet contracts/HappyVoteLeaderboard.sol, Verified
Testnet contracts/HappyVote-Re-Genesis.sol, Verified
Mainnet contracts/HappyVoteLeaderboard.sol, Verified
Sepolia contracts/HappyVoteLeaderboard.sol, Verified
Mainnet contracts/HappyVoteLeaderboard.sol, Verified
Testnet contracts/HappyVoteLeaderboard.sol, Verified
Any questions, bug report or feedback: