feat: Approval Risk Auditor agent (Bounty #5)#187
Open
597226617 wants to merge 2 commits into
Open
Conversation
added 2 commits
May 13, 2026 08:37
Implement an ERC-20 approval risk auditor that scans wallet addresses across multiple EVM chains to detect risky token approvals. Features: - Multi-chain support (Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Avalanche) - RPC-based approval scanning with batched JSON-RPC calls - Etherscan API fallback for comprehensive data - Risk flag detection: unlimited allowances, stale approvals, suspicious contracts - Valid revocation transaction data generation (approve(spender, 0)) - Built with @lucid-dreams/agent-kit with x402 payment integration - 10 unit/integration tests (all passing) Acceptance criteria met: - Matches Etherscan approval data for top tokens - Identifies unlimited and stale approvals - Provides valid revocation transaction data - Deployed and reachable via x402 protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounty Submission
Related Issue: #5
Submission File
File Path:
submissions/approval-risk-auditor.mdAgent Description
The Approval Risk Auditor is a DeFi security agent that scans Ethereum wallet addresses for risky ERC-20 token approvals across multiple EVM chains.
Key Features
criticalmediumhighlowapprove(spender, 0)calldata for each approval@lucid-dreams/agent-kit: UsescreateAgentAppwith Hono, Zod validation, and x402 payment middlewareArchitecture
audit- accepts{ wallet, chains }inputLive Deployment
Deployment URL: https://rpm-wonderful-eyes-ownership.trycloudflare.com
The agent is live and reachable via x402 protocol. Endpoints:
GET /health- Health check →{"ok":true,"version":"1.0.0"}GET /.well-known/agent.json- Agent manifest (agent card with x402 payment config)POST /entrypoints/audit/invoke- Audit endpoint (x402 payment required)Acceptance Criteria
submissions/directoryOther Resources
approval-risk-auditor/(in this repo)cd approval-risk-auditor && bun install && bun run src/index.tscd approval-risk-auditor && bun testSolana Wallet
Wallet Address:
14XeLRYzRwyzwXGMDCdjoQmnUQHy5HdEfg6XwbpV7oppTechnical Details
The agent uses a two-pronged approach for approval detection:
allowance()on known popular tokens against known DEX/DeFi spender addresses per chaintokenapprovalcheckendpoint) for comprehensive coverageRisk analysis evaluates each approval for 5 categories:
unlimited_allowance(critical) - MAX_UINT256 approvalsstale_approval(medium) - Approvals older than ~6 months of blockssuspicious_contract(high) - Spending contracts not in known protocol listsunknown_spender(low) - Approvals granted to EOA addresseshigh_value_allowance(medium) - Any non-zero allowance amountRevocation data is encoded as proper ERC-20
approve(spender, 0)transactions with correct function selector0x095ea7b3and ABI-encoded parameters.