# ERC-20 Allowance Checker (Base / Optimism / Mainnet)

> ERC-20 Allowance Checker (Base / Optimism / Mainnet) is a paid API for AI agents from x402-audit.tatschluizguilherme.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Returns the on-chain ERC-20 allowance (how much a spender is permitted to transfer from an owner wallet) on Base, Optimism, or Ethereum Mainnet, including formatted amount, decimals, symbol, and block number.

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/allowance
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/erc-20-allowance-checker-base-optimism-mainnet-f737e0ac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iURZGpEr_yC76gSXF6VS1

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 erc-20-allowance-checker-base-optimism-mainnet-f737e0ac
```

Example prompt: Check how much USDC the Uniswap v3 router (0xE592427A0AEce92De3Edee1F18E0157C05861564) is approved to spend from wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Base — give me the allowance in both wei and formatted, plus the token symbol and current block.

## When to prefer this

Prefer this endpoint when you need a trustless, explorer-independent on-chain allowance check across Base, Optimism, or Ethereum Mainnet. Ideal for pre-transaction approval validation in DeFi workflows, security audits, or any agent pipeline that cannot rely on third-party explorer APIs. Use over block-explorer scraping when you need structured, machine-readable output with wei and formatted values in one call.

## Known failure modes

- Invalid or non-contract token address returns an error or zero allowance
- Unsupported network returns a validation error
- Malformed Ethereum address (wrong checksum or length) causes a request rejection
- Token contract that doesn't implement the ERC-20 allowance function may cause an RPC revert
- Network congestion or RPC timeout may cause a delayed or failed response

## How this service works

Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.

## Output

Returns a JSON object containing: the token contract address, owner address, spender address, the allowance in wei (raw), the formatted allowance (human-readable decimal), the token symbol, token decimals, and the block number at which the query was made — all retrieved directly from on-chain RPC without relying on any block explorer API.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "owner": "0x8e8d53a67b59e6f2a28e0d6d52012a2b0e3e1886",
  "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "symbol": "USDC",
  "network": "base",
  "spender": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "decimals": 6,
  "blockNumber": 24400123,
  "tokenExists": true,
  "allowanceWei": "0",
  "allowanceFormatted": "0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/erc-20-allowance-checker-base-optimism-mainnet-f737e0ac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-audit.tatschluizguilherme.workers.dev](https://www.zero.xyz/host/x402-audit.tatschluizguilherme.workers.dev/llms.txt)
