# Contract ABI Lookup via Sourcify (agent402.tools)

> Contract ABI Lookup via Sourcify (agent402.tools) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Fetches the verified ABI and human-readable function signatures with 4-byte selectors for an EVM smart contract address from Sourcify, across 8 mainnets.

## Facts

- Endpoint: POST https://agent402.tools/api/contract-abi
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/contract-abi-lookup-via-sourcify-agent402-tools-05d7ae6e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_t90GM4jmhKSSKwDSqxWeg

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 contract-abi-lookup-via-sourcify-agent402-tools-05d7ae6e -d '<json body>'
```

Example prompt: Can you fetch the verified ABI and function signatures for the contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum — I need to know what functions it exposes and their 4-byte selectors.

## When to prefer this

Use this endpoint when you need to programmatically discover the interface of an EVM smart contract — its ABI, callable functions, and 4-byte selectors — without manually searching Etherscan or other block explorers. Ideal when building agents that need to interact with unknown contracts, decode transaction calldata, or validate a contract's interface before calling it. Covers 8 EVM mainnets including Ethereum, Base, Polygon, Arbitrum, Optimism, BSC, Gnosis, and Celo.

## Known failure modes

- Contract not verified on Sourcify — returns {verified: false} structured miss
- Invalid or malformed contract address — likely 400 or structured error
- Unsupported network name — falls back to base or errors
- Contract exists but has no source code submitted to Sourcify
- Network temporarily unavailable — upstream Sourcify timeout

## How this service works

Fetch the verified ABI for a contract address from Sourcify, plus a ready-to-use list of human-readable function signatures with their 4-byte selectors. Covers 8 EVM mainnets. Unverified contracts return a structured {verified:false} miss. Pair with /api/calldata-decode to decode transactions against this ABI.

## Output

Returns the verified ABI array for the contract, plus a list of human-readable function signatures paired with their 4-byte selectors. If the contract is unverified on Sourcify, returns a structured {verified: false} object indicating a miss.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "description": "0x-prefixed 40-char contract address."
  },
  "network": {
   "type": "string",
   "description": "ethereum / base / polygon / arbitrum / optimism / bsc / gnosis / celo (default base)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "abi": [
   {
    "name": "implementation",
    "type": "function",
    "inputs": [],
    "outputs": [
     {
      "type": "address"
     }
    ]
   }
  ],
  "match": "exact_match",
  "events": [
   {
    "signature": "Upgraded(address)"
   }
  ],
  "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "chainId": 8453,
  "network": "base",
  "verified": true,
  "functions": [
   {
    "selector": "0x5c60da1b",
    "signature": "implementation()"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/contract-abi-lookup-via-sourcify-agent402-tools-05d7ae6e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
