https://github.com/davidweb3-ctrl/mantle-agent-payment-guard
AI-assisted payment safety receipts for onchain agent actions on Mantle
https://github.com/davidweb3-ctrl/mantle-agent-payment-guard
Last synced: 22 days ago
JSON representation
AI-assisted payment safety receipts for onchain agent actions on Mantle
- Host: GitHub
- URL: https://github.com/davidweb3-ctrl/mantle-agent-payment-guard
- Owner: davidweb3-ctrl
- Created: 2026-05-27T03:43:43.000Z (28 days ago)
- Default Branch: main
- Last Pushed: 2026-05-27T03:52:29.000Z (28 days ago)
- Last Synced: 2026-05-27T05:26:23.330Z (28 days ago)
- Language: JavaScript
- Size: 391 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mantle Agent Payment Guard
AI-assisted payment safety for onchain agent actions on Mantle.
## Pitch
AI agents are becoming capable of initiating payments, subscriptions, and treasury actions. Mantle Agent Payment Guard adds a review step before value moves: the app analyzes a payment intent, shows human-readable risk signals, and records a compact payment-safety receipt on a Mantle smart contract.
## What It Does
- Reviews an AI-agent payment intent before an onchain write.
- Scores risk based on amount, recipient format, purpose, and risky language.
- Creates an intent hash for a reproducible audit trail.
- Records a payment-safety receipt on Mantle Sepolia.
- Shows users the transaction link after recording.
## Architecture
```text
User / wallet
-> React frontend
-> local AI-style risk review engine
-> Mantle Sepolia smart contract
-> PaymentIntentRecorded event / receipt lookup
```
The current demo uses a deterministic local review engine so the app is easy to run and verify during the hackathon. A production version would call a hosted model or policy engine before writing the receipt.
## Smart Contract
`contracts/AgentPaymentGuard.sol` stores reviewed payment intent receipts:
- user address;
- agent address;
- recipient;
- amount;
- token symbol;
- intent hash;
- risk score;
- risk summary;
- source chain id;
- timestamp.
## Mantle Network
The project targets Mantle Sepolia for low-cost hackathon proof:
- Chain ID: `5003`
- RPC: `https://rpc.sepolia.mantle.xyz`
- Explorer: `https://explorer.sepolia.mantle.xyz`
## Local Setup
```bash
npm install
npm run test:contracts
npm run dev
```
Open the printed Vite URL and test the local review flow.
## Public Frontend
Current public demo:
```text
https://davidweb3-ctrl.github.io/mantle-agent-payment-guard/
```
## Demo Video
```text
https://github.com/davidweb3-ctrl/mantle-agent-payment-guard/raw/main/demo/mantle-agent-payment-guard-demo.mp4
```
The video is about 2 minutes and 16 seconds long, uses real project screenshots plus the deployed Mantle Sepolia evidence, and explains the pre-payment safety receipt flow. The latest render aligns each slide with the ElevenLabs narration sequence.
The static frontend can be published with GitHub Pages:
```bash
npm run deploy:pages
```
## Deploy To Mantle Sepolia
Create `.env` from `.env.example`, then set:
```text
PRIVATE_KEY=your_test_wallet_private_key
MANTLE_SEPOLIA_RPC_URL=https://rpc.sepolia.mantle.xyz
```
Deploy:
```bash
source .env
npm run deploy:mantle-sepolia
```
After deployment, set:
```text
VITE_CONTRACT_ADDRESS=0x...
```
Then rebuild and publish the frontend.
## Current Deployment
Public frontend:
```text
https://davidweb3-ctrl.github.io/mantle-agent-payment-guard/
```
Mantle Sepolia contract:
```text
0x4965e045fBA701c8d98B445155e82B2E153e7335
```
Explorer:
```text
https://explorer.sepolia.mantle.xyz/address/0x4965e045fBA701c8d98B445155e82B2E153e7335
```
Deployment transaction:
```text
0x45f245e4d916d0f4cf0f97438e21267d399059069a27f4cfe2a3dae405160dce
```
Transaction explorer:
```text
https://explorer.sepolia.mantle.xyz/tx/0x45f245e4d916d0f4cf0f97438e21267d399059069a27f4cfe2a3dae405160dce
```
Deployment block:
```text
39163481
```
First usage transaction:
```text
0x7264d23c8e5c0a3e57559e9af64b81bfba42dd13f5c65ae3e13299101633c1fa
```
Usage transaction explorer:
```text
https://sepolia.mantlescan.xyz/tx/0x7264d23c8e5c0a3e57559e9af64b81bfba42dd13f5c65ae3e13299101633c1fa
```
Usage block:
```text
39163828
```
Onchain receipt count:
```text
1
```
This demo video is ready to use for the DoraHacks submission.
## Verification
Local verification completed on 2026-05-27:
```bash
npm run test:contracts
npm run build
```
Result:
- Foundry: 4 contract tests passed.
- Vite: production build passed.
- Browser check: local and GitHub Pages frontend loaded with live risk scoring.
- Mantle Sepolia RPC check: deployed contract bytecode exists and deployment receipt has `status 1`.
- Mantle Sepolia usage check: first `recordPaymentIntent` transaction has `status 1`, emitted `PaymentIntentRecorded`, and `receiptCount()` returns `1`.
## Hackathon Track
The Turing Test Hackathon 2026 - `AI DevTools`.