A web application that uses GenAI to analyze Solidity smart contracts for potential vulnerabilities and security issues.
- Sign in, then upload a .sol (Solidity) file
- The file is sent to an LLM (Groq - LLaMA 3.1) with a security-auditor system prompt
- The model returns a structured severity rating and list of findings (reentrancy, integer overflow, unchecked external calls, access-control issues, etc.)
- Results are rendered as a report page
- Backend: Flask
- GenAI: Groq API - LLaMA 3.1
- Frontend: HTML/CSS/JS (vanilla), Bootstrap for the report page
cd web_app
pip install -r requirements.txt Set environment variables (never hardcode secrets):
export GROQ_API_KEY="your_groq_api_key"
export APP_USERNAME="your_chosen_username" # optional, defaults to "demo"
export APP_PASSWORD="your_chosen_password" # optional, defaults to "demo123" Run it:
python app.py Visit http://localhost:5000.
pip install -r requirements-dev.txt
pytest tests/ -v An earlier version of this repo had a real email/password hardcoded in app.py and committed to git history. That credential has since been rotated and the code now reads login credentials from environment variables only - nothing sensitive is hardcoded. debug=True has also been removed for safe deployment.