How evin009/verifypto works
Project Type and Purpose
• Verifypto is a full-stack web application (Python/Flask backend + static HTML frontend) that lets users verify the credibility of Ethereum wallets and smart contracts by combining on-chain data analysis with AI summarization.
File-Structure Analysis
Top-level components:
• app.py – Flask application entry point with REST endpoints
• config_example.py – placeholder for API keys and configuration
• etherscan_helper.py – code that fetches transactions, token data, contract source from Etherscan APIs
• gemini_helper.py – code that wraps calls to Google Gemini AI for risk summarization
• verifier.py – orchestrates the risk-scoring logic, applies heuristics (blacklist checks, onlyOwner flags, etc.)
• mongodb_setup.py – establishes connection to MongoDB Atlas and defines history schema
• frontend/ – static HTML files (index.html, auth.html, dashboard.html)
• requirements.txt – Python dependencies (Flask, pymongo, requests, etc.)
External services/tools: Ngrok (for dev tunneling), MongoDB Atlas, Etherscan API, Google Gemini API.
README Insights
• Backend: Flask + custom Python modules
• AI Analysis: Google Gemini for human-friendly verdicts
• Data persistence: MongoDB Atlas for lookup history
• Core challenges: on-chain data interpretation, prompt engineering, API integration
Main Components
a. Client Side
• Web Browser → Static HTML/CSS/JS pages served by Flask
b. Backend/API Layer (Flask)
• Endpoint “/verify” accepts wallet/contract addresses
• Relies on helper modules
c. Helper Modules (Internal Services)
• EtherscanHelper: fetches on-chain data
• Verifier: computes risk scores and flags
• GeminiHelper: sends on-chain summary to Google Gemini → receives risk verdict
• MongoDBSetup: records and fetches verification history
d. External Services
• Etherscan REST API
• Google Gemini AI API
• MongoDB Atlas (cloud database)
• (Ngrok for development exposure)
Interactions and Data Flow
1. User enters address → frontend form submits to Flask
2. Flask “/verify” handler invokes EtherscanHelper → on-chain data
3. Verifier processes raw data, applies heuristics
4. GeminiHelper sends summary prompt → receives narrative verdict
5. Combined result saved via MongoDBSetup into Atlas
6. Flask returns verdict + risk level to frontend dashboard
7. User can view past lookups from history endpoint
Architectural Patterns and Design Principles
• Separation of concerns:
• Presentation layer (static frontend)
• Application/API layer (Flask)
• Domain logic (verifier, helper modules)
• Data layer (MongoDB)
• Single-responsibility in helper modules
• External integration points clearly separated