TokenFon Faucet Project
What is TokenFon Faucet?
TokenFon Faucet, developed by Cerratech for TokenFon, is designed to support new users and developers by covering gas fees on the TokenFon testnet chain. This faucet allows users to request tokens to pay for transaction fees while interacting with the testnet, ensuring smooth and easy access to the platform for testing purposes.
The platform provides a seamless way for users and developers to obtain testnet tokens, enabling them to interact with and test applications on the TokenFon testnet without the need to purchase tokens or pay gas fees upfront.
What Does It Bring?
Core Functionalities
- Gas Fee Coverage: Provides testnet tokens to cover transaction fees for users and developers
- Testnet Accessibility: Ensures smooth and easy access to the TokenFon testnet for testing purposes
- Abuse Prevention: 24-hour cooldown system per wallet address and IP address to prevent misuse
- User-Friendly Interface: Easy-to-use platform aligned with TokenFon's branding
Technical Capabilities
- Secure Token Distribution: Smart contract-based distribution with designated executor permissions
- Scalable Architecture: MongoDB queuing system with cron job processing for high request volumes
- Modern Wallet Integration: Support for popular crypto wallets through wagmi.sh and WalletConnect
- Flexible Distribution: Both individual and batch token distribution methods supported
How It Works
Architecture Components
The TokenFon Faucet consists of three main components:
1. User Interface (UI)
- Framework: Built using Shadcn/ui framework with React
- Wallet Integration: Uses wagmi.sh and WalletConnect for modern and stable wallet connections
- Custom Branding: UI customized with TokenFon's colors and images for consistent branding
- Responsive Design: Modern, user-friendly interface with focus on ease of use
2. API - Executor Service
- Request Handling: Backend processes requests from the frontend through MongoDB queuing
- Cron Job Processing: Automated processing of queued requests using scheduled tasks
- Rate Limiting: Ensures users can only request tokens once every 24 hours per wallet address and IP
- Secure Execution: Executor service holds private key for secure contract interactions
3. Solidity Smart Contract
- Configurable Distribution: Contract initialized with distribution token, amount, and supply settings
- Cooldown Management: 24-hour cooldown applied to each wallet address to prevent abuse
- Executor Permissions: Only designated executors can trigger token distributions
- Owner Controls: Contract owner can add or remove executors as needed
- Distribution Methods: Supports both individual and batch distribution functionality
Request Process
- User Connection: User connects their wallet through the web interface
- Request Submission: User submits a request for testnet tokens
- Validation: System checks cooldown period for wallet address and IP
- Queue Processing: Valid requests are queued in MongoDB for processing
- Automated Execution: Cron jobs process queued requests and trigger contract distributions
- Token Distribution: Smart contract distributes tokens to the requesting wallet address
Technical Implementation
Technology Stack
- Smart Contracts: Solidity for token distribution contract
- Frontend: React.js with Shadcn/ui framework
- Backend: API service with MongoDB data storage
- Task Scheduling: Cron jobs for automated request processing
- Wallet Integration: wagmi.sh and WalletConnect for wallet interactions
Deployment Infrastructure
- Frontend: Cloudflare Pages for UI deployment
- Backend: Google Cloud for API service deployment
Key Features
- Modern UI Framework: Shadcn/ui chosen for ease of use, industry adoption, and quick learning curve
- Robust Rate Limiting: Dual protection with wallet address and IP-based cooldowns
- Scalable Queue System: MongoDB-based queuing mechanism for efficient high-volume handling
- Flexible Contract Design: Configurable token distribution with multiple distribution methods
- TokenFon Branding: Complete visual alignment with TokenFon's design guidelines
Project Scope & Limitations
Included Features
- UI development using Shadcn/ui with React for a user-friendly interface
- API development for request handling and queuing with MongoDB and cron jobs
- Solidity contract development for token distribution with cooldown functionality
- Integration with WalletConnect for secure wallet interactions
- Customization of UI colors and images to align with TokenFon branding
Excluded Features
- Integration of reCAPTCHA or other additional validation mechanisms (deferred for future updates)
- Support for automated user feedback or testing iterations
- Additional features outside the basic faucet functionality, such as advanced analytics or custom user tracking
- Support for non-testnet or live environments
Project Assumptions
- The TokenFon testnet chain remains stable for the duration of the project
- Executors are adequately managed to ensure smooth contract interactions
- No need for extensive user validation mechanisms like reCAPTCHA in the initial version
This Faucet implementation provides TokenFon with a secure, scalable, and user-friendly solution for testnet token distribution, enabling smooth onboarding and testing experiences for users and developers while maintaining proper abuse prevention mechanisms.