A decentralized platform that combines artificial intelligence with blockchain technology to revolutionize how grants are distributed to impactful projects. Built on Celo blockchain for accessibility, transparency, and fairness.
🌐 Live Demo: https://ai-grant-nine.vercel.app/
🎥 Video Demo: https://youtu.be/pcZ6CAegM8I
📜 Smart Contract: 0x0243FD476b211BC4FB086f33876Af847868fdDd7 (Celo Alfajores)
- About the Project
- Key Features
- How It Works
- Technology Stack
- Smart Contract
- Screenshots
- Getting Started
- Project Structure
- Contributing
This platform addresses a critical challenge in the blockchain ecosystem: fair and transparent grant distribution. Traditional grant processes are often opaque, time-consuming, and subject to bias. Our solution leverages AI to analyze projects objectively based on real metrics while using Celo's blockchain to ensure complete transparency and automated execution.
The system evaluates projects through multiple dimensions including code quality, community engagement, sustainability, and impact potential. Registered companies vote on proposals, and when consensus is reached, grants are automatically distributed through smart contracts.
Live Contract Address (Celo Alfajores Testnet):
0x0243FD476b211BC4FB086f33876Af847868fdDd7
For Project Owners:
- Submit grant proposals with GitHub integration
- Real-time AI analysis of project metrics
- Track voting progress and funding status
- View complete funding history
- Receive grants directly to wallet
For Companies/Voters:
- AI-assisted project evaluation
- Detailed scoring across multiple criteria
- Transparent voting on blockchain
- Track assigned projects
- Review voting history
For Administrators:
- Manage treasury funds (CELO deposits)
- Register and assign companies to projects
- Monitor all project submissions
- View comprehensive analytics
- Configure AI scoring parameters
Platform-Wide:
- Native CELO token support (no stablecoins needed)
- Mobile-friendly responsive design
- Real-time blockchain synchronization
- Complete transparency of all transactions
- Secure wallet integration via RainbowKit
Projects connect their wallet and submit proposals with details including:
- Project name and description
- GitHub repository URL
- Requested grant amount
The system automatically fetches GitHub metrics including commits, stars, forks, issues resolved, and contributor activity.
Our AI analyzes projects across five key dimensions:
- Code Quality (0-25 points): Analyzes commit frequency, code structure, and development activity
- Community Engagement (0-20 points): Evaluates stars, forks, and contributor participation
- Sustainability (0-20 points): Assesses long-term viability and maintenance patterns
- Impact Potential (0-15 points): Measures potential ecosystem contribution
- Innovation (0-20 points): Reviews uniqueness and technical advancement
Total impact score ranges from 0-100, providing objective project assessment.
Administrators assign projects to registered companies for review. Companies can:
- View AI-generated analysis and scores
- Review detailed project breakdowns
- Cast votes (Approve/Reject) on blockchain
- Track their voting history
When a project receives majority approval (3 out of 5 company votes), the smart contract automatically:
- Transfers the requested CELO amount from treasury
- Records the transaction on blockchain
- Updates project funding status
- Adds to public funding history
All steps are transparent and verifiable on the Celo blockchain.
Blockchain & Smart Contracts:
- Solidity 0.8.20
- Hardhat development environment
- Celo blockchain (Alfajores testnet)
- OpenZeppelin contracts for security
Frontend:
- Next.js 14 (React framework)
- TypeScript for type safety
- Tailwind CSS for styling
- Framer Motion for animations
Web3 Integration:
- RainbowKit for wallet connection
- wagmi hooks for contract interaction
- viem for Ethereum utilities
AI & Data:
- Google Gemini API for project analysis
- GitHub API for repository metrics
- Real-time data processing
Infrastructure:
- Vercel for deployment
- Environment-based configuration
- Responsive mobile-first design
Contract Name: GrantDistributionCELO
Network: Celo Alfajores Testnet
Address: 0x0243FD476b211BC4FB086f33876Af847868fdDd7
Project Management:
proposeProject()- Submit new grant proposalsgetProject(uint256)- Retrieve project detailsprojectCount()- Get total number of projects
Voting System:
vote(uint256, bool)- Cast vote on assigned projectgetProjectAssignedCompanies(uint256)- View assigned votershasVoted(uint256, address)- Check if company voted
Treasury:
depositToTreasury()- Add CELO to grant pool (payable)getTreasuryBalance()- View available fundsdistributeGrant(uint256)- Execute approved grant distribution
Administration:
registerCompany(address, string)- Register voting companiesassignProjectToCompany(uint256, address)- Assign projects to voterssetMajorityThreshold(uint256)- Configure voting threshold
ProjectProposed- New project submittedVoteCast- Company voted on projectProjectApproved- Project reached voting thresholdGrantDistributed- Funds transferred to projectTreasuryDeposit- Funds added to treasury
Modern landing page with animated 3D background and clear call-to-action
Project owners can submit proposals, track voting status, and view funding history
Companies review AI analysis and cast votes on assigned projects
Administrators manage treasury, register companies, and monitor all activities
Before you begin, ensure you have:
- Node.js 18.0 or higher installed
- A Celo-compatible wallet (MetaMask, Valora, etc.)
- Testnet CELO tokens from Celo Faucet
- Clone the repository:
git clone https://github.com/Sumanpradhan1706/AI-Powered-Grant-Distribution-on-Celo.git
cd AI-Powered-Grant-Distribution-on-Celo- Install dependencies:
npm install- Create environment file:
cp .env.example .env.local- Configure your
.env.localfile:
# Google Gemini API (Free tier available)
GEMINI_API_KEY=your_gemini_api_key
# GitHub API Token (for repository analysis)
GITHUB_TOKEN=your_github_token
# Celo Configuration
NEXT_PUBLIC_CELO_NETWORK=alfajores
NEXT_PUBLIC_CONTRACT_ADDRESS=0x0243FD476b211BC4FB086f33876Af847868fdDd7
# WalletConnect Project ID
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
# Admin wallet address
NEXT_PUBLIC_OWNER_ADDRESS=your_admin_wallet_addressDevelopment mode:
npm run devProduction build:
npm run build
npm startAccess the application at http://localhost:3000
If you want to deploy your own contract:
- Add your private key to
.env.local:
PRIVATE_KEY=your_wallet_private_key- Compile contracts:
npx hardhat compile- Deploy to Alfajores testnet:
npx hardhat run scripts/deployCELO.ts --network alfajores- Update
NEXT_PUBLIC_CONTRACT_ADDRESSwith your new contract address
AI-Powered-Grant-Distribution-on-Celo/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ ├── ai/score/ # AI scoring endpoint
│ │ ├── contract/ # Contract interaction APIs
│ │ └── github/ # GitHub data fetching
│ ├── admin/ # Admin dashboard page
│ ├── company/ # Company voting page
│ ├── dashboard/ # User dashboard page
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── admin/ # Admin panel components
│ ├── company/ # Voting components
│ ├── dashboard/ # User dashboard components
│ └── landing/ # Landing page components
├── contracts/ # Solidity smart contracts
│ └── GrantDistributionCELO.sol
├── scripts/ # Deployment scripts
│ └── deployCELO.ts
├── public/ # Static assets
│ ├── Hero.png
│ ├── User.png
│ ├── Voting.png
│ ├── Admin1.png
│ └── logo.svg
├── lib/ # Utility libraries
├── hardhat.config.ts # Hardhat configuration
├── next.config.js # Next.js configuration
└── package.json # Dependencies
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code follows the existing style and includes appropriate tests.
- Repository: GitHub
- Issues: Report bugs or request features through GitHub Issues
- Contract Address:
0x0243FD476b211BC4FB086f33876Af847868fdDd7
- Built on Celo blockchain for mobile-first accessibility
- Powered by Google Gemini for AI analysis
- UI components inspired by modern Web3 design patterns
- Special thanks to the Celo community for support and resources
Note: This platform is currently deployed on Celo Alfajores testnet for testing purposes. Always use testnet tokens and never share private keys or sensitive information.
- Deploy contracts to Alfajores testnet
npm run deployCopy the contract address from the output and add it to your .env file as NEXT_PUBLIC_CONTRACT_ADDRESS.
- Set up Supabase database
Run these SQL commands in your Supabase SQL editor:
-- Create projects table
CREATE TABLE projects (
id BIGSERIAL PRIMARY KEY,
project_address TEXT NOT NULL,
name TEXT NOT NULL,
description TEXT,
github_url TEXT NOT NULL,
impact_score INTEGER DEFAULT 0,
total_grants_received NUMERIC DEFAULT 0,
is_active BOOLEAN DEFAULT true,
is_verified BOOLEAN DEFAULT false,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
-- Create impact_scores table
CREATE TABLE impact_scores (
id BIGSERIAL PRIMARY KEY,
project_id BIGINT REFERENCES projects(id),
score INTEGER NOT NULL,
github_activity INTEGER,
community_engagement INTEGER,
milestones_completed INTEGER,
ai_analysis JSONB,
calculated_at TIMESTAMP DEFAULT NOW()
);
-- Create grant_distributions table
CREATE TABLE grant_distributions (
id BIGSERIAL PRIMARY KEY,
project_id BIGINT REFERENCES projects(id),
amount TEXT NOT NULL,
token_address TEXT NOT NULL,
transaction_hash TEXT NOT NULL,
reason TEXT,
distributed_at TIMESTAMP DEFAULT NOW()
);
-- Create indexes
CREATE INDEX idx_projects_address ON projects(project_address);
CREATE INDEX idx_projects_score ON projects(impact_score DESC);
CREATE INDEX idx_grants_project ON grant_distributions(project_id);- Run the development server
npm run devOpen http://localhost:3000 in your browser.
- Repository: GitHub
- Issues: Report bugs or request features through GitHub Issues
- Contract Address:
0x0243FD476b211BC4FB086f33876Af847868fdDd7
- Built on Celo blockchain for mobile-first accessibility
- Powered by Google Gemini for AI analysis
- UI components inspired by modern Web3 design patterns
- Special thanks to the Celo community for support and resources
Note: This platform is currently deployed on Celo Alfajores testnet for testing purposes. Always use testnet tokens and never share private keys or sensitive information.