A Next.js application for classifying blockchain smart contracts into predefined categories using Google Gemini AI.
This application allows users to:
- Input smart contract addresses (via text entry or CSV file upload)
- Automatically classify contracts into predefined categories (DeFi, NFT, Social, etc.)
- Associate contracts with projects
- Export classification results as CSV
The classifier uses the Google Gemini API to analyze contract names and addresses and determine the most appropriate category based on predefined definitions.
- Multiple Input Methods: Paste addresses or upload CSV files
- Project Assignment: Assign contracts to specific projects
- Chain Detection: Automatic or manual chain selection
- AI-Powered Classification: Uses Google Gemini 1.5 Flash for accurate contract categorization
- Export Results: Save classification results as CSV
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the application.
You'll need a Google API key to use the classification functionality:
- Get an API key from Google AI Studio
- Set the
GOOGLE_API_KEYenvironment variable or enter your API key in the application settings
GEMINI_API_KEY=your_gemini_api_key_hereThe application uses context caching for system prompts over 1024 tokens to optimize costs and performance. The cache is automatically managed with a 1-hour TTL (Time To Live).
The application uses predefined categories in category_definitions.yml to classify contracts into groups like:
- DeFi (DEX, Lending, Derivatives, etc.)
- NFT (Marketplaces, Collections, NFT Finance)
- Social (Community, Gaming, Governance)
- Utility (Account Abstraction, Oracles, etc.)
- And more
- Next.js - React framework
- React - UI library
- Google Gemini API - AI-powered classification
- TypeScript - Type safety
This project is proprietary software.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.