# Contract Source Code Lookup (Sourcify)

> Contract Source Code Lookup (Sourcify) is a paid API for AI agents from chain.openverbs.com, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-10).

Fetches verified Solidity/Vyper source code, compiler settings, and metadata for a deployed smart contract address from Sourcify across major EVM chains.

## Facts

- Endpoint: POST https://chain.openverbs.com/v1/source?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/contract-source-code-lookup-sourcify-7eb60d8a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FMuFOOUQMpyjNXgghGf_e

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-code-lookup-sourcify-7eb60d8a -d '<json body>'
```

Example prompt: Can you pull up the verified Solidity source code for the contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum, including its compiler version and optimizer settings?

## When to prefer this

Use this endpoint when you need the full human-readable source code of a deployed smart contract for auditing, LLM analysis, or understanding contract logic — especially when you need compiler settings and all source files together. Prefer this over block explorer scraping because it returns structured JSON with Sourcify-verified data across five major EVM chains in a single call. Best when the contract is likely verified (popular DeFi/NFT protocols almost always are). If you only need the ABI or bytecode, a different endpoint may be more efficient.

## Known failure modes

- Contract not verified on Sourcify — returns verified:false with no source files
- Invalid or malformed contract address (not 0x + 40 hex chars) — validation error
- Chain not supported (outside ethereum/base/arbitrum/optimism/polygon) — enum validation error
- Contract address does not exist on the specified chain — empty or not-found response
- Network timeout reaching chain RPC or Sourcify — falls back to cache, may return stale data
- Payment failure for x402 microtransaction — request rejected before execution

## How this service works

Get the verified Solidity/Vyper source code for a deployed contract by address, sourced from Sourcify. Returns every source file (path + content), the contract name, language, compiler version and compiler settings (optimizer, evmVersion) — the full human-readable source an agent needs to read, audit or feed to an LLM. Supports Ethereum, Base, Arbitrum, Optimism, Polygon. Unverified contracts return `verified:false`. Live reads with cache fallback.

## Output

Returns a JSON object indicating whether the contract is verified. If verified, includes an array of all source files (each with a file path and full source content), the contract name, the programming language (Solidity or Vyper), the compiler version, and compiler settings such as optimizer enabled/runs and evmVersion. If unverified, returns verified:false with no source data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "ethereum",
    "base",
    "arbitrum",
    "optimism",
    "polygon"
   ],
   "type": "string",
   "description": "EVM chain to query. One of: ethereum, base, arbitrum, optimism, polygon. Default \"ethereum\"."
  },
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "Deployed contract address."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/contract-source-code-lookup-sourcify-7eb60d8a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chain.openverbs.com](https://www.zero.xyz/host/chain.openverbs.com/llms.txt)
