A decentralized platform that enables creators to set up multiple funding goals and receive tips from fans. The platform uses PYUSD (PayPal USD) stablecoin for payments and distributes funds across different goals based on predefined percentages.
- Multi-Goal Distribution: Creators can set up multiple funding goals with different targets and percentages
- Automatic Fund Distribution: Tips are automatically split across active goals based on their percentages
- Goal Management: Create, track, and claim goals with comprehensive metadata support
- Creator Registration: Username-based creator system with metadata URI support
- Secure Payments: Built on PYUSD stablecoin with reentrancy protection
- π Web3 Integration - Connect wallets with RainbowKit and Wagmi
- π± Responsive Design - Modern UI with glassmorphism effects
- ποΈ IPFS Storage - Decentralized file storage using Irys
- βοΈ Smart Contract Integration - Deploy and interact with contracts on Sepolia
Crund/
βββ hardhat/ # Smart contract development
β βββ contracts/
β β βββ CreatorGoalDistributor.sol
β βββ scripts/
β βββ test/
β βββ hardhat.config.js
β βββ package.json
βββ website/ # Next.js frontend
βββ src/
β βββ app/
β βββ components/
β βββ lib/
βββ public/
βββ package.json
- Node.js (v18 or higher)
- npm or yarn
- Git
- MetaMask or compatible Web3 wallet
- Sepolia testnet ETH for gas fees
- PYUSD tokens on Sepolia testnet
git clone <repository-url>
cd CrundNavigate to the hardhat directory and install dependencies:
cd hardhat
npm installCreate a .env file in the hardhat directory:
# .env
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_API_KEY
PRIVATE_KEY=your_private_key_hereDeploy the contract to Sepolia:
npm run deployImportant: Save the deployed contract address and PYUSD token address for the frontend configuration.
Navigate to the website directory:
cd ../website
npm installCreate environment variables:
cp env.example .envFill in your .env file:
# .env
IRYS_RPC_URL=https://testnet-rpc.irys.xyz/v1/execution-rpc
# WalletConnect Project ID (get from https://cloud.walletconnect.com/)
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your-walletconnect-project-id
# Add your deployed contract address and PYUSD address
NEXT_PUBLIC_CONTRACT_ADDRESS=your_deployed_contract_address
NEXT_PUBLIC_PYUSD_ADDRESS=pyusd_token_address_on_sepolianpm run devOpen http://localhost:3000 to view the application.
The main contract implements a sophisticated goal-based funding system:
registerCreator(metadataURI, username): Register as a creator with metadata and unique usernamecreateGoal(name, metadataURI, target, percentage): Create funding goals with specific targets and percentage allocationstip(creatorAddr, amount): Send tips to creators (automatically distributed across active goals)claimGoal(goalIndex): Claim funds when a goal is reachedgetActiveGoals(creator): Retrieve all active goals for a creatorgetOldGoals(creator): Retrieve completed/claimed goals
- Maximum 20 goals per creator
- Percentage-based fund distribution (total percentages must not exceed 100%)
- Automatic remainder distribution to creator when tips exceed goal allocations
- Goal completion tracking with events
- Username-based creator lookup
- Reentrancy protection for secure transactions
CreatorRegistered: When a new creator registersGoalCreated: When a new goal is createdTipReceived: When a tip is received and distributedGoalReached: When a goal reaches its targetGoalClaimed: When a creator claims a completed goal
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS with Framer Motion animations
- Web3: Wagmi v2, RainbowKit, Viem
- Storage: Irys for decentralized file storage
- State Management: TanStack Query for server state
- Web3Provider: Wraps the app with Web3 context
- CreateModal: Main interface for creator registration and goal creation
- WalletConnection: RainbowKit integration for wallet management
- ReentrancyGuard: Prevents reentrancy attacks
- Ownable: Contract ownership management
- Input Validation: Comprehensive parameter validation
- Safe Math: Built-in overflow protection
- Access Control: Creator-only functions with proper authentication
- Connect Wallet: Use the "Create" button to connect your Web3 wallet
- Register: Provide username and metadata URI for your creator profile
- Create Goals: Set up multiple funding goals with specific targets and percentages
- Receive Tips: Fans can tip you, and funds are automatically distributed across your goals
- Claim Goals: When a goal reaches its target, claim the funds
- Connect Wallet: Connect your Web3 wallet to the platform
- Browse Creators: Find creators by username
- Send Tips: Send PYUSD tokens to support your favorite creators
- Track Progress: Monitor goal progress and completion
cd hardhat
npx hardhat testcd website
npm run dev- Configure your
.envfile with Sepolia RPC URL and private key - Ensure you have Sepolia ETH for gas fees
- Run the deployment script:
npm run deploy- Build the production version:
npm run build- Deploy to your preferred platform (Vercel, Netlify, etc.)
- Testnet: Sepolia
- Token: PYUSD (PayPal USD) on Sepolia
- Storage: Irys decentralized storage
- RPC: Configured via environment variables
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_API_KEY
PRIVATE_KEY=your_private_key_here
IRYS_RPC_URL=https://testnet-rpc.irys.xyz/v1/execution-rpc
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your-walletconnect-project-id
NEXT_PUBLIC_CONTRACT_ADDRESS=your_deployed_contract_address
NEXT_PUBLIC_PYUSD_ADDRESS=pyusd_token_address_on_sepolia
This project is licensed under the MIT License - see the LICENSE file for details.
Built for EthGlobal Online 2025 π