Welcome to CreatorsHub, an innovative blockchain donation platform that allows creators to accept any ERC20 token as a donation and automatically convert it to ETH. By leveraging the 1inch API for optimal exchange rates, CreatorsHub makes cryptocurrency donations simpler than ever.
CreatorsHub is a cryptocurrency donation platform where users can donate to creators using any ERC20 token. The system automatically converts tokens to ETH through 1inch. The platform uses smart contracts to ensure that each creator has a dedicated donation address and can easily withdraw funds.
- 🚀 Donate using any ERC20 token
- 🔄 System uses 1inch API to automatically convert tokens to ETH (at best rates)
- 📊 Each creator has their own donation contract
- 💸 Creators can withdraw funds anytime
- ✅ Complete transaction records and status tracking
CreatorsHub/
├── public_frontend/ # React frontend application
├── public_contract/ # Smart contracts (Solidity)
├── 1inch-vercel-proxy/ # 1inch API proxy server
├── proxy.js # Local API proxy
| Layer | Technology |
|---|---|
| Frontend | React + TypeScript + Tailwind CSS |
| Token Exchange | 1inch API 🔥 |
| Smart Contracts | Solidity + Factory Pattern |
| Blockchain SDK | ethers.js / web3.js |
| Transaction Tracking | Custom transaction components |
| Security Management | Environment variables + API proxy |
An intuitive UI that lets users easily select and donate tokens, track transaction status.
- ✅ Multi-token selector
- 🔄 Real-time token conversion quotes
- 💰 Donation form and confirmation
- 📜 Transaction history
- 🔍 Real-time transaction status tracking
- Framework: React + TypeScript
- Styling: Tailwind CSS
- API Integration: 1inch Swap API
- Networking: Fetch API
- State Management: React Context/Hooks
CreatorsHub leverages the 1inch API to ensure users get the best token exchange rates:
- Forwards API requests through a proxy server to protect API keys
- Gets real-time token prices and gas fee estimates
- Executes token swaps at optimal rates
- Accepts over 50 common ERC20 tokens as donations
- User selects token and enters amount
- System queries 1inch API for real-time quote
- Displays estimated results including exchange rate and gas fees
- User confirms donation to execute transaction
- Transaction is submitted to blockchain
- System tracks transaction status and updates UI
- DonationFactory: Creates and manages personal donation contracts
- CreatorDonation: Handles donations, token swaps, and withdrawal functions
- ISwapRouter: Interface for interacting with 1inch router
Core contract logic for the donation system, including:
- Factory pattern for deploying personal donation contracts
- Token swap router configuration
- Multi-token donation handling
- Secure withdrawal mechanisms
- Transaction event logging
- Supporter NFT minting capabilities
To protect API keys and simplify frontend integration, the system uses proxy servers:
- Forward frontend requests to 1inch API
- Add necessary authentication and API keys
- Handle errors and responses
- Support multiple API endpoints
-
Frontend Environment:
REACT_APP_API_PROXY_URL: API proxy URLREACT_APP_CHAIN_ID: Blockchain network IDREACT_APP_FACTORY_ADDRESS: Contract factory address
-
Proxy Environment:
ONEINCH_API_KEY: 1inch API keyPORT: Proxy server port
- Fork this project
- Create a branch:
git checkout -b feature/amazing - Commit changes:
git commit -m "Add feature" - Push:
git push origin feature/amazing - Open a PR