# ERC20 Allowance Risk Checker

> ERC20 Allowance Risk Checker is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-16).

Returns the exact ERC20 token allowance an owner has granted to a spender and flags whether the approval is unlimited, signaling potential fund-drain risk before a transaction.

## Facts

- Endpoint: GET https://api.x402node.dev/chain/allowance-risk
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/erc20-allowance-risk-checker-122756d5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q2z7Ow-NipKo7HmmDDHyf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability erc20-allowance-risk-checker-122756d5
```

Example prompt: Before I interact with this Uniswap router contract, check the ERC20 allowance and approval risk for owner 0xAbc...123, spender 0xDef...456, token 0x6B17...A1 on Ethereum — specifically flag if it's an unlimited approval that could drain my funds.

## When to prefer this

Use this endpoint when an AI agent needs to perform a pre-transaction safety check on ERC20 token approvals — specifically to detect unlimited approvals that expose a wallet to full-balance drain risk. Prefer this over generic blockchain explorers when you need a structured, machine-readable risk flag rather than raw on-chain data, and when the agent needs to decide whether to recommend revoking an approval before proceeding with a DeFi interaction.

## Known failure modes

- Invalid or non-existent token contract address returns an error
- Unsupported chain/network returns a chain-not-supported error
- Malformed wallet address (wrong checksum or length) returns a validation error
- RPC node unavailability may cause a timeout or upstream error
- Zero allowance returned when no approval has been granted (not an error, but may be misinterpreted)

## How this service works

Check the exact ERC20 allowance an owner granted a spender and flag unlimited approvals that let a contract drain funds - a pre-transaction safety check agents need that LLMs cannot perform. allowance risk, approval risk, unlimited approval, spender risk, revoke check, token approval safety Accepts payment on Base or Solana — either network works.

## Output

Returns the numeric allowance the owner has granted to the spender for the specified ERC20 token, a boolean or flag indicating whether the approval is unlimited (max uint256), and a risk assessment indicating whether the spender could potentially drain the owner's token balance.

## Example request

```json
{
 "chain": "ethereum",
 "owner": "0x1234567890123456789012345678901234567890",
 "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
 "spender": "0x0987654321098765432109876543210987654321"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token",
      "owner",
      "spender"
     ],
     "properties": {
      "owner": {
       "type": "string",
       "description": "Token owner (required)"
      },
      "token": {
       "type": "string",
       "description": "ERC20 contract (required)"
      },
      "address": {
       "type": "string",
       "description": "EVM/chain address (optional)"
      },
      "spender": {
       "type": "string",
       "description": "Spender contract (required)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/erc20-allowance-risk-checker-122756d5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
