MantleGuard is an AI-powered smart contract security auditor built specifically for the Mantle blockchain ecosystem. It allows developers to paste any Solidity contract and receive a comprehensive security audit, gas optimization report, and Mantle compatibility analysis — all in under 30 seconds. Audits can be permanently published on-chain to Mantle Mainnet.
Deployed on Vercel: mantle-guard.vercel.app
- AI-Powered Security Analysis — Uses GPT-4o to detect 12+ vulnerability classes including reentrancy, tx.origin auth, integer overflow, selfdestruct, delegatecall, and more
- Mantle Network Integration — Detects Mantle Mainnet (chainId 5000) automatically, auto-switches MetaMask to Mantle, and generates Mantle-specific compatibility reports
- Web3 Wallet Authentication — Real MetaMask connection via
window.ethereum, with multi-wallet support (EIP-6963), account change listeners, and network detection - On-Chain Audit Publishing — Encodes audit data (contract name, hash, score, risk) in ABI-encoded calldata and sends a real transaction to Mantle Mainnet — your audit lives on-chain forever
- Security Score (0–100) — Risk rating: SAFE / LOW / MEDIUM / HIGH / CRITICAL
- Gas Optimization Report — Mantle L2-specific tips plus general Solidity optimizations
- Mantle Explorer Integration — Every published audit links directly to the Mantle Explorer transaction
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite + TypeScript |
| Styling | Tailwind CSS v4 + shadcn/ui |
| Web3 | ethers.js v6 + MetaMask |
| AI | OpenAI GPT-4o (via API) |
| Chain | Mantle Mainnet (chainId 5000) |
| Deployment | Vercel |
- Node.js 20+
- MetaMask browser extension
- MNT tokens on Mantle Mainnet for publishing audits (tiny gas fee ~$0.001)
# Clone the repo
git clone https://github.com/umerf23/mantleguard.git
cd mantleguard
# Install dependencies
npm install
# Start the dev server
npm run devThe app will be available at http://localhost:5173
- Push to GitHub
- Import the repo at vercel.com/new
- Set Framework Preset to
Vite - Add environment variable:
OPENAI_API_KEY= your OpenAI API key - Deploy
Connect MetaMask — MantleGuard auto-detects if you're on Mantle Mainnet and offers to switch networks if needed.
Paste Solidity source code directly, or enter a contract address to fetch it from Mantle Explorer.
GPT-4o analyzes the contract for:
- Reentrancy vulnerabilities
- Access control issues (tx.origin, missing modifiers)
- Integer overflow/underflow
- Unsafe delegatecall and low-level calls
- Selfdestruct risks
- Flash loan attack vectors
- Block timestamp dependency
- Unprotected public functions
- Outdated compiler versions
- And more...
Click Publish Audit on Mantle to send a real transaction to Mantle Mainnet. The audit report is ABI-encoded in calldata and permanently stored on-chain, viewable on Mantle Explorer.
| Property | Value |
|---|---|
| Chain ID | 5000 (Mainnet) / 5003 (Testnet) |
| RPC URL | https://rpc.mantle.xyz |
| Explorer | https://explorer.mantle.xyz |
| Native Token | MNT |
| Block Time | ~2 seconds |
This project was built for the Mantle Official AI Bounty track.
Requirements met:
- ✅ Mantle network integration (chainId 5000, auto-switch, on-chain publishing)
- ✅ Real Web3 wallet authentication (MetaMask, EIP-6963 multi-wallet)
- ✅ AI-powered contract analysis (GPT-4o)
- ✅ Deployable on Vercel
- ✅ On-chain audit registry transactions on Mantle Mainnet
MIT — built with love for the Mantle ecosystem.