The Problem: Independent GameFi developers and beauty brands face significant barriers to capital acquisition:
- Traditional funding channels are opaque, centralized, and inaccessible to early-stage founders
- Lengthy approval processes delay product development and market entry
- Investor trust is compromised by intermediaries and escrow mismanagement
- Geographic and regulatory restrictions limit funding pool access
The Solution: GameFund is a trustless, decentralized crowdfunding protocol built on Ethereum that eliminates intermediaries and enables milestone-based fund releases through smart contract automation. Creators retain full transparency, investors gain cryptographic security guarantees, and capital flows directly via blockchain verification.
Impact: This dApp reimagines Web3 fundraising by combining:
- ✅ Immutable Campaign Histories – All funding activity on-chain and verifiable
- ✅ Milestone-Based Payouts – Automated fund release tied to developer-defined milestones
- ✅ Decentralized Governance – No single entity controls capital flow
- ✅ Gas-Optimized Smart Contracts – Reduced transaction costs via efficient Solidity patterns
- ✅ Institutional-Grade Security – Reentrancy guards, input validation, and pull-payment architecture
| Component | Technology | Purpose |
|---|---|---|
| UI Framework | React 18+ | Component-driven, high-performance rendering |
| Styling | TailwindCSS 3.3+ | Utility-first CSS for responsive design |
| Language | TypeScript 5.0+ | Type-safe development, reduced runtime errors |
| State Management | React Hooks | Simplified state orchestration with Context API |
| Component | Technology | Purpose |
|---|---|---|
| Wallet Connection | Thirdweb SDK | Multi-chain wallet support (MetaMask, WalletConnect, Coinbase) |
| Contract Interaction | Thirdweb Contracts API | Type-safe smart contract method invocation |
| Event Listening | Ethers.js (via Thirdweb) | Real-time blockchain event subscriptions |
| Transaction Signing | Web3 Provider** | Secure, user-controlled transaction approval |
| Contract | Purpose | Network |
|---|---|---|
| CampaignFactory.sol | Campaign lifecycle management and creation | Ethereum Sepolia |
| Campaign.sol | Individual campaign logic, funds escrow, milestone tracking | Ethereum Sepolia |
| PaymentHandler.sol | Pull-over-Push payment pattern, withdrawal logic | Ethereum Sepolia |
| Layer | Implementation |
|---|---|
| Network | Ethereum Sepolia Testnet |
| Gas Optimization | Batch operations, storage packing, selective indexing |
| Contract Verification | Etherscan (Full source code published) |
| Deployment Tool | Hardhat / Foundry |
// ✅ SECURE: Investors withdraw funds themselves (pull)
function withdrawFunds() external {
uint256 amount = investorBalances[msg.sender];
require(amount > 0, "No funds available");
investorBalances[msg.sender] = 0; // State change first
(bool success, ) = msg.sender.call{value: amount}("");
require(success, "Withdrawal failed");
}
// ❌ AVOIDED: Sending funds to investors (push)
// This would allow contract addresses to reject transfersWhy: Pull patterns are reentrancy-proof and give investors control over fund recovery.
All state-modifying functions follow the CEI principle to prevent reentrancy attacks:
function releaseMilestonePayment(uint256 milestoneId) external onlyOwner {
// 1. CHECKS - Validate preconditions
require(milestone[milestoneId].isCompleted == false, "Already released");
require(block.timestamp >= milestone[milestoneId].releaseDate, "Too early");
// 2. EFFECTS - Modify contract state
milestone[milestoneId].isCompleted = true;
campaignBalance -= milestone[milestoneId].amount;
// 3. INTERACTIONS - External calls last
(bool success, ) = owner.call{value: milestone[milestoneId].amount}("");
require(success, "Payment failed");
}Protection: State is finalized before external calls, preventing reentrancy loops.
modifier onlyCreator() {
require(msg.sender == campaignCreator, "Unauthorized creator");
_;
}
modifier onlyActive() {
require(status == CampaignStatus.ACTIVE, "Campaign inactive");
_;
}
modifier nonReentrant() {
require(!locked, "No reentrancy");
locked = true;
_;
locked = false;
}| Optimization | Implementation |
|---|---|
| Storage Packing | Group related variables to minimize SSTORE operations |
| Fixed Arrays | Use fixed-size arrays instead of dynamic arrays where possible |
| Batch Operations | Process multiple investor refunds in single transaction |
| Event Indexing | Index critical parameters for efficient off-chain filtering |
| Lazy Evaluation | Calculate milestone completion on-demand, not on-block |
// ✅ OPTIMIZED: Storage packing (single slot)
struct Campaign {
address creator; // 20 bytes
uint96 fundingGoal; // 12 bytes (fits in 32 bytes total with creator)
uint32 deadline; // 4 bytes
uint8 status; // 1 byte
}
// ❌ SUBOPTIMAL: Unpacked storage (multiple slots)
struct Campaign {
address creator; // Slot 1
uint256 fundingGoal; // Slot 2
uint256 deadline; // Slot 3
uint8 status; // Slot 4
}- Permissioned Contract Extension – Role-based access control for campaign creators
- Custom Metadata URIs – IPFS-backed campaign metadata for immutable campaign details
- Safe Multi-Signature Extension – Multi-sig wallet support for large campaign treasuries
- ✅ Input Validation – All external inputs validated before processing
- ✅ Overflow/Underflow Protection – Solidity 0.8+ built-in SafeMath
- ✅ Role-Based Access Control (RBAC) – Fine-grained permissions for creator/investor/admin roles
- ✅ Emergency Pause Mechanism – Admin can halt campaign operations during security incidents
- ✅ Etherscan Verification – Smart contract source code publicly auditable
- ✅ No Delegatecall – Eliminates proxy-based attack vectors
| Contract | Address | Etherscan Link |
|---|---|---|
| CampaignFactory | 0x1234... |
View on Etherscan |
| Campaign (Template) | 0x5678... |
View on Etherscan |
| PaymentHandler | 0x9ABC... |
View on Etherscan |
📌 Note: Replace placeholder addresses with actual deployment addresses before production.
CampaignFactory.initialize(
feePercentage: 2.5%, // Platform fee (250 = 2.5%)
treasuryAddress: 0x..., // Fee collection wallet
maxCampaignDuration: 90 days, // Max funding period
minFundingGoal: 0.1 ETH // Minimum raise threshold
);- Node.js 18+ and npm 9+
- Git
- MetaMask or compatible Web3 wallet
- Sepolia Testnet ETH (from Sepolia Faucet)
git clone https://github.com/yeswadams/Web3-CrowdFunding-App.git
cd Web3-CrowdFunding-Appnpm installCreate a .env.local file in the project root:
# Thirdweb SDK Configuration
REACT_APP_THIRDWEB_CLIENT_ID=your_thirdweb_client_id
REACT_APP_CONTRACT_CHAIN=sepolia
REACT_APP_CONTRACT_ADDRESS=0x...
# Smart Contract Addresses (Sepolia)
REACT_APP_CAMPAIGN_FACTORY=0x...
REACT_APP_PAYMENT_HANDLER=0x...
# RPC Endpoints
REACT_APP_RPC_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID
# Feature Flags
REACT_APP_ENABLE_TESTNET_MODE=true
REACT_APP_LOG_TRANSACTIONS=trueTo obtain Thirdweb Client ID:
- Visit Thirdweb Dashboard
- Create a new API key
- Copy the Client ID to
.env.local
npm startThe application will be available at http://localhost:3000
- Open the browser wallet extension (MetaMask)
- Switch network to Ethereum Sepolia
- Click "Connect Wallet" button in the dApp
- Approve wallet connection
# Compile contracts
npm run contracts:compile
# Deploy to Sepolia
npm run contracts:deploy:sepolia
# Verify contracts on Etherscan
npm run contracts:verifyWeb3-CrowdFunding-App/
├── src/
│ ├── components/ # React components (Campaign, Dashboard, Wallet)
│ ├── pages/ # Page-level components (Home, Campaigns, Profile)
│ ├── hooks/ # Custom React hooks (useContract, useCampaign)
│ ├── utils/ # Utility functions (contract ABI, formatting)
│ ├── styles/ # TailwindCSS config and global styles
│ └── App.tsx # Main app component
├── contracts/ # Solidity smart contracts
│ ├── CampaignFactory.sol
│ ├── Campaign.sol
│ └── PaymentHandler.sol
├── hardhat.config.ts # Hardhat configuration
├── .env.local # Environment variables (not in git)
├── package.json # Dependencies and scripts
└── README.md # This file
- ✅ Create a campaign with funding goal, deadline, and milestone schedule
- ✅ Submit milestone proof (transaction hash, GitHub commit) for fund release
- ✅ Receive funds directly to wallet upon milestone completion
- ✅ Full transparency of investor base and fund allocation
- ✅ Browse active campaigns with verified contract details
- ✅ Contribute to projects and receive verifiable proof on-chain
- ✅ Vote on milestone acceptance (governance-enabled campaigns)
- ✅ Withdraw funds if milestones are missed (optional refund mechanism)
- ✅ Collect platform fees (2.5% default)
- ✅ Verify campaign creators through KYC integration (optional)
- ✅ Pause malicious campaigns in real-time
- ✅ Monitor total value locked (TVL) and campaign metrics
# Unit tests for smart contracts
npm run test:contracts
# Frontend component tests
npm run test:frontend
# Integration tests (blockchain)
npm run test:integration
# Code coverage
npm run test:coverage| Metric | Value |
|---|---|
| Smart Contract Size | ~8 KB (optimized) |
| Deployment Gas Cost | ~1.2M gas (Sepolia) |
| Average Campaign Creation | ~120K gas |
| Fund Withdrawal | ~50K gas (optimized) |
| Frontend Bundle Size | ~450 KB (gzipped) |
| Security Audits | Pending (OpenZeppelin recommended) |
- Automated contract testing with Foundry
- OpenZeppelin formal audit
- Bug bounty program launch
- Mainnet deployment readiness
- Insurance protocol integration (Nexus Mutual)
I'm actively seeking Blockchain Engineer and Smart Contract Developer opportunities. Let's build the future of decentralized finance together.
| Platform | Link |
|---|---|
| linkedin.com/in/yeswadams | |
| Portfolio | yeswadams.dev |
| contact@yeswadams.dev | |
| GitHub | @yeswadams |
This project is licensed under the MIT License – see the LICENSE file for details.
- Thirdweb – For exceptional Web3 SDK and contract extensions
- Ethereum Foundation – For Sepolia testnet and EIP standards
- OpenZeppelin – For battle-tested smart contract libraries
- TailwindCSS – For responsive, utility-first design system
- Solidity Documentation
- Thirdweb SDK Docs
- Ethereum Sepolia Testnet
- Smart Contract Security Best Practices
- Etherscan API Documentation
Last Updated: June 2026 | Status: Active Development 🚀