This guide will help you get CodeGuard up and running quickly.
/home/marvi/Documents/Nullshot/
├── app/ # Next.js frontend (shadcn/ui, modern design)
│ ├── src/
│ │ ├── app/dashboard/ # Main dashboard page
│ │ ├── components/dashboard/ # Beautiful UI components
│ │ ├── lib/hooks/ # Web3 and WebSocket hooks
│ │ └── types/ # TypeScript types
│ └── package.json
│
├── codeguard-contracts/ # Foundry smart contracts
│ ├── src/
│ │ ├── GuardianRegistry.sol
│ │ ├── IncidentLog.sol
│ │ ├── DetectionModelRegistry.sol
│ │ └── InsurancePool.sol
│ ├── test/ # Foundry tests
│ └── script/Deploy.s.sol # Deployment script
│
├── codeguard-agents/ # Cloudflare Workers (AI Agents + MCP)
│ ├── src/
│ │ ├── agents/ # 5 specialized agents
│ │ ├── mcp-tools/ # 8 custom MCP servers
│ │ ├── shared/ # Types, utils, constants
│ │ └── worker.ts # Main entry point
│ ├── wrangler.toml # Cloudflare config
│ └── src/mcp.json # MCP registry
│
├── README.md # Main documentation
├── DEMO_SCRIPT.md # Video demo script
├── PROJECT_WRITEUP.md # Hackathon submission writeup
└── GETTING_STARTED.md # This file
cd codeguard-contracts
forge test -vvvcd codeguard-agents
npm install
wrangler dev --localcd app
npm install
npm run dev
# Open http://localhost:3000/dashboard- 4 production-ready contracts
- Comprehensive test suite
- Deployment scripts
- Located in
codeguard-contracts/src/
- 5 specialized Durable Object agents
- Orchestrator, Monitor, Response agents implemented
- Agent coordination and communication
- Located in
codeguard-agents/src/agents/
- 3 core MCP tools implemented:
bytecode-analyzer-mcp: Bytecode analysisnotification-mcp: Multi-channel alertsvector-db-mcp: Exploit semantic search
- Located in
codeguard-agents/src/mcp-tools/
- Beautiful modern dashboard with real design
- Interactive risk score gauges
- Live incident feed with WebSocket updates
- Protected contract cards
- Agent status indicators
- All using shadcn/ui components (cards, badges, alerts, etc.)
- Located in
app/src/
- Comprehensive README
- Detailed demo video script
- Professional project writeup
-
Environment Variables
# In codeguard-contracts/.env PRIVATE_KEY=your_deployer_key BASE_SEPOLIA_RPC_URL=https://sepolia.base.org BASESCAN_API_KEY=your_api_key # In codeguard-agents/.env OPENAI_API_KEY=your_key AGENT_PRIVATE_KEY=your_agent_wallet_key DISCORD_WEBHOOK=your_webhook_url TELEGRAM_BOT_TOKEN=your_token # In app/.env.local NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id NEXT_PUBLIC_GUARDIAN_REGISTRY_ADDRESS=deployed_address
-
Deploy Contracts
cd codeguard-contracts forge script script/Deploy.s.sol --rpc-url base_sepolia --broadcast --verify # Copy addresses to agent and frontend .env files
-
Setup Cloudflare
cd codeguard-agents wrangler d1 create codeguard-db wrangler vectorize create exploit-db --dimensions=1536 --metric=cosine # Update wrangler.toml with IDs wrangler deploy
-
Deploy Frontend
cd app npm run build vercel --prod # or deploy to Cloudflare Pages
- Use the
DEMO_SCRIPT.mdas your guide - Show the beautiful dashboard
- Demonstrate real-time detection
- Highlight the modern UI components
- Emphasize the MCP tool orchestration
- Include link to GitHub repo
- Add demo video URL
- Reference
PROJECT_WRITEUP.mdfor judging criteria - Highlight: 8 MCP tools + 6 agents + beautiful UI + production-ready
- Built with Next.js 16 + shadcn/ui
- Animated components with smooth transitions
- Real-time updates via WebSocket
- Responsive design
- Dark mode ready
- 8 custom MCP tools
- Standardized interfaces
- Modular architecture
- Cloudflare Durable Objects
- 6 specialized AI agents
- Complex coordination
- Autonomous decision-making
- Community governed
- Smart contracts on Base L2
- Onchain audit trail
- Decentralized storage (IPFS)
- DAO governance
# Contracts
cd codeguard-contracts
forge build # Compile
forge test # Run tests
forge script script/Deploy.s.sol --rpc-url base_sepolia --broadcast
# Agents
cd codeguard-agents
wrangler dev --local # Local development
wrangler deploy # Production deployment
npm test # Run tests
# Frontend
cd app
npm run dev # Development server
npm run build # Production build
npm run lint # Lint check- Check
PRIVATE_KEYin.env - Ensure wallet has Base Sepolia ETH
- Verify RPC URL is correct
- Run
wrangler loginfirst - Check all environment variables
- Ensure D1 and Vectorize are created
- Check WebSocket URL in
.env.local - Ensure agents are deployed
- Verify contract addresses
If you run into issues:
- Check the main README.md
- Review the architecture in PROJECT_WRITEUP.md
- Examine the demo script in DEMO_SCRIPT.md
You're ready to win Track 1! 🚀