A comprehensive AI-powered blockchain automation system built on the Celo network, featuring smart contract deployment, AI agent management, NFT operations, and DeFi integrations.
- Natural Language Processing: Create automations using plain English
- Gemini AI Integration: Advanced AI decision-making capabilities
- Smart Contract Deployment: Automated contract deployment and management
- Multi-Agent System: Coordinated AI agents for complex operations
- Celo Network Support: Full integration with Celo mainnet and Alfajores testnet
- Multi-Token Support: Native CELO, cUSD, cEUR, and cREAL tokens
- DeFi Protocols: Integration with Moola, Ubeswap, and Curve
- NFT Operations: Mint, transfer, and manage NFTs
- Security Analysis: Transaction risk assessment and approval workflows
- Next.js 14: Latest React framework with App Router
- Tailwind CSS: Beautiful, responsive UI components
- Real-time Updates: WebSocket integration for live data
- Dashboard Analytics: Comprehensive system monitoring and insights
- REST API: Comprehensive API for all blockchain operations
- WebSocket Support: Real-time communication
- Database Integration: SQLite for data persistence
- Security Features: Rate limiting, input validation, and authentication
Build on Celo/
โโโ Frontend/ # Next.js frontend application
โ โโโ app/ # App Router pages
โ โโโ components/ # Reusable UI components
โ โโโ lib/ # Utility functions and services
โ โโโ hooks/ # Custom React hooks
โโโ Backend/ # Node.js backend services
โ โโโ automation-system.js # Main automation engine
โ โโโ data/ # SQLite database
โ โโโ examples/ # Usage examples
โโโ blockchain/ # Smart contracts and blockchain tools
โ โโโ packages/
โ โ โโโ core/ # Core blockchain functionality
โ โ โโโ contracts/ # Solidity smart contracts
โ โ โโโ api/ # REST API server
โ โโโ hardhat.config.js # Hardhat configuration
โโโ docs/ # Documentation
Our smart contracts are live and functional on the Celo testnet:
Contract Deployment Details:
-
AgentRegistry:
0x28d19bce67566423719B2E471f578b765F4375BA- Transaction:
0xe0ea61d187d2626742554a58ce5ba1f3ac47b6c92ea673db678da0c03a4a2e13 - Block: 60447833
- Gas Used: 1,793,298
- Status: โ Success
- Transaction:
-
AgentTreasury:
0x52F3f3C2d1610454E6c3345b5E02DA767dC4f4D2- Transaction:
0x1ee24ac3f85a71dc0f3c1e2b2dc827fc894f0cd8e7463a82510b4fee37c980bb - Block: 60447840
- Gas Used: 2,468,811
- Status: โ Success
- Transaction:
-
AttendanceNFT:
0xeD42659476443dE01d113322E156913EA056332F- Transaction:
0x0c622edcbb59a5d4f51624e2ed0d0ccda4476a76a01380743ec5dab79391774a - Block: 60447847
- Gas Used: 3,080,093
- Status: โ Success
- Transaction:
View on Celo Explorer:
Transaction Verification: All contracts have been successfully deployed with confirmed transactions showing:
- โ Contract creation transactions confirmed
- โ Gas optimization achieved (smaller contract sizes)
- โ Modular architecture implemented
- โ Independent contract management enabled
/celo-ai-agents/
โโโ packages/
โ โโโ contracts/ # Smart contracts (Solidity)
โ โโโ core/ # Main library package (TypeScript)
โโโ examples/ # Usage examples
โโโ docs/ # Developer documentation
โโโ tests/ # Integration tests
- Node.js 18+
- npm or yarn
- Git
-
Clone the repository
git clone https://github.com/deep-ghosh/celo-automator.git cd celo-automator -
Install dependencies
# Install frontend dependencies cd Frontend npm install # Install backend dependencies cd ../Backend npm install # Install blockchain dependencies cd ../blockchain npm install
-
Environment Setup
# Copy environment files cp Backend/env.example Backend/.env cp Frontend/env.example Frontend/.env.local cp blockchain/packages/api/env.example blockchain/packages/api/.env -
Configure Environment Variables
Backend (.env)
GEMINI_API_KEY=your_gemini_api_key PRIVATE_KEY=your_wallet_private_key NETWORK=alfajores RPC_URL=https://alfajores-forno.celo-testnet.org PORT=3001
Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:3001 NEXT_PUBLIC_NETWORK=alfajores
-
Start the Backend Server
cd Backend npm startServer will run on http://localhost:3001
-
Start the Frontend
cd Frontend npm run devFrontend will run on http://localhost:3000
-
Start the Blockchain API (Optional)
cd blockchain/packages/api npm run devAPI will run on http://localhost:3000
The AI automation system allows you to create complex blockchain workflows using natural language:
// Example: Create an automation
const automation = {
name: "Treasury Rebalancing",
description: "Automatically rebalance treasury when cUSD drops below 40%",
trigger: "token_balance_change",
conditions: {
token: "cUSD",
threshold: 0.4,
operator: "less_than"
},
actions: [
{
type: "swap",
from: "CELO",
to: "cUSD",
amount: "1000"
}
]
};Deploy and manage smart contracts with ease:
// Deploy a contract
const deployment = await deployContract({
network: 'alfajores',
contractName: 'AgentRegistry',
constructorArgs: []
});
console.log('Contract deployed at:', deployment.contractAddress);Mint and manage NFTs:
// Mint an NFT
const nft = await mintNFT({
to: walletAddress,
tokenURI: "https://metadata.example.com/1",
contractAddress: "0x..."
});Monitor system performance and automation metrics:
- Real-time Metrics: Live updates on automation status
- Performance Analytics: Execution times and success rates
- Cost Analysis: Gas usage and transaction costs
- Security Monitoring: Risk assessment and alerts
POST /api/automate- Create new automationGET /api/automations- List all automationsPOST /api/blockchain/function-call- Execute blockchain functionGET /api/analytics- Get system analyticsWebSocket /ws- Real-time updates
import { ApiClient } from './lib/api-client';
const api = new ApiClient('http://localhost:3001');
// Create automation
const automation = await api.createAutomation({
name: "My Automation",
description: "Automated treasury management",
// ... configuration
});
// Execute automation
const result = await api.executeAutomation(automation.id, {
walletAddress: "0x...",
// ... context
});- Risk Assessment: AI-powered transaction analysis
- Approval Workflows: Multi-signature requirements
- Gas Optimization: Automatic gas limit calculation
- Address Validation: Comprehensive address checking
- Rate Limiting: Prevent abuse and DDoS attacks
- Input Validation: Sanitize all user inputs
- Authentication: Secure API access
- CORS Protection: Cross-origin request security
- System Health: Server status and performance
- Automation Status: Live execution monitoring
- Error Tracking: Comprehensive error logging
- Performance Metrics: Response times and throughput
- Usage Statistics: User activity and patterns
- Cost Analysis: Gas usage and transaction costs
- Success Rates: Automation execution success rates
- Trend Analysis: Historical performance data
# Backend tests
cd Backend
npm test
# Frontend tests
cd Frontend
npm test
# Integration tests
npm run test:integration- Unit Tests: Individual component testing
- Integration Tests: End-to-end workflow testing
- Performance Tests: Load and stress testing
- Security Tests: Vulnerability assessment
-
Environment Configuration
# Set production environment variables export NODE_ENV=production export GEMINI_API_KEY=your_production_key export PRIVATE_KEY=your_production_key
-
Build Applications
# Build frontend cd Frontend npm run build # Build backend cd Backend npm run build
-
Deploy to Cloud
- Frontend: Deploy to Vercel, Netlify, or similar
- Backend: Deploy to Railway, Heroku, or AWS
- Database: Use PostgreSQL or MongoDB for production
# Dockerfile example
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3001
CMD ["npm", "start"]- 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
- Follow the existing code style
- Write comprehensive tests
- Update documentation
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the
/docsfolder for detailed guides - Issues: Report bugs and request features on GitHub
- Discussions: Join community discussions
- Email: Contact the development team
Backend Connection Refused
# Check if backend is running
curl http://localhost:3001/health
# Start backend if not running
cd Backend && npm startToken Balance Errors
- Ensure you're connected to the correct network
- Check token contract addresses
- Verify wallet connection
AI Automation Not Working
- Check Gemini API key configuration
- Verify network connectivity
- Review automation logs
- Celo Foundation for blockchain infrastructure
- Google AI for Gemini integration
- Next.js Team for the amazing framework
- Open Source Community for inspiration and support
- Multi-chain support (Ethereum, Polygon)
- Advanced AI models integration
- Mobile application
- Advanced analytics dashboard
- Community marketplace for automations
- Enterprise features and support
- v2.0.0 - Current version with AI integration
- v1.0.0 - Initial release with basic automation
Built with โค๏ธ for the Celo ecosystem
For more information, visit our documentation or GitHub repository.