# Contract Source & ABI Lookup

> Contract Source & ABI Lookup is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-17).

Returns verified source code, parsed ABI, compiler settings, and proxy info for any deployed contract on Ethereum, Base, Optimism, Arbitrum, or Polygon.

## Facts

- Endpoint: POST https://x402.agentutility.ai/contract-source?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/contract-source-abi-lookup-200eb4d8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_I5yOsjNsZMs2ZcTjdexCX

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-source-abi-lookup-200eb4d8 -d '<json body>'
```

Example prompt: Can you fetch the verified source code and ABI for the contract at 0x4200000000000000000000000000000000000006 on Base?

## When to prefer this

Use this endpoint when you need verified Solidity source code, a parsed ABI, or compiler metadata for a deployed contract across Ethereum, Base, Optimism, Arbitrum, or Polygon — without managing your own Etherscan API keys or multi-chain explorer integrations. It's ideal for agents that need to dynamically discover contract interfaces at runtime, audit contract code, or resolve proxy implementations before calling a contract.

## Known failure modes

- Contract address not found on the specified chain — returns is_verified: false or error
- Contract exists but is not verified on the block explorer — source_code and ABI will be empty or null
- Invalid 0x address format — returns a validation error
- Unsupported chain value — returns an enum validation error
- Block explorer API rate limits or downtime — may return a timeout or upstream error

## How this service works

Returns verified source code and ABI for any deployed contract on Ethereum, Base, Optimism, Arbitrum, or Polygon. Includes is_verified, contract name, compiler version, parsed ABI, full source, license, optimizer settings, constructor args, and proxy implementation address. Use it as an Etherscan source lookup, contract ABI fetcher, or Solidity source lookup.

## Output

A JSON object containing: is_verified (boolean), contract name, chain, address, parsed ABI array (with function names, inputs, outputs, and state mutability), full Solidity source code, license string, compiler version, optimization settings (runs and enabled), constructor arguments, and a proxy flag with implementation address if applicable. Also includes the source explorer URL.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "polygon",
        "arbitrum",
        "optimism"
       ],
       "type": "string",
       "description": "EVM chain. Default 'base'. Other supported: 'ethereum', 'polygon', 'arbitrum', 'optimism'."
      },
      "address": {
       "type": "string",
       "description": "0x-prefixed 20-byte EVM contract address."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "abi": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "inputs": {
          "type": "array"
         },
         "outputs": {
          "type": "array"
         },
         "stateMutability": {
          "type": "string"
         }
        }
       }
      },
      "name": {
       "type": "string"
      },
      "chain": {
       "type": "string"
      },
      "proxy": {
       "type": "boolean"
      },
      "source": {
       "type": "string"
      },
      "address": {
       "type": "string"
      },
      "license": {
       "type": "string"
      },
      "is_verified": {
       "type": "boolean"
      },
      "source_code": {
       "type": "string"
      },
      "optimization": {
       "type": "object",
       "properties": {
        "runs": {
         "type": "integer"
        },
        "enabled": {
         "type": "boolean"
        }
       }
      },
      "compiler_version": {
       "type": "string"
      },
      "constructor_arguments": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "abi": [
   {
    "name": "deposit",
    "type": "function",
    "inputs": [],
    "outputs": [],
    "stateMutability": "payable"
   },
   {
    "name": "withdraw",
    "type": "function",
    "inputs": [
     {
      "name": "wad",
      "type": "uint256"
     }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
   }
  ],
  "name": "WETH",
  "chain": "base",
  "proxy": false,
  "source": "https://etherscan.io",
  "address": "0x4200000000000000000000000000000000000006",
  "license": "None",
  "is_verified": true,
  "source_code": "pragma solidity ^0.4.18;\ncontract WETH9 { ... }",
  "optimization": {
   "runs": 200,
   "enabled": false
  },
  "compiler_version": "v0.4.18+commit.9cf6e910",
  "constructor_arguments": ""
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/contract-source-abi-lookup-200eb4d8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
