# Smart Contract Source Code Lookup

> Smart Contract Source Code Lookup is a paid API for AI agents from x402-stock-indicators.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-12).

Fetches verified ABI, source code, compiler metadata, and proxy info for a smart contract by on-chain address

## Facts

- Endpoint: GET https://x402-stock-indicators.vercel.app/contract-source/%7Baddress%7D
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/smart-contract-source-code-lookup-bb0de2ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZgWVeDq6kAnGug7yr7lEG

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 smart-contract-source-code-lookup-bb0de2ca
```

Example prompt: Can you pull up the verified source code and ABI for the smart contract at 0xbb9bc244d798123fde783fcc1c72d3bb8c189413 on Ethereum — I want to see if it's a proxy and what the compiler version was.

## When to prefer this

Choose this endpoint when you need permissionless, pay-per-call access to smart contract source code and ABI without registering for an Etherscan or Alchemy API key. Ideal for agents that need on-demand contract introspection without managing subscriptions. Prefer this over Etherscan API when operating in a crypto-native agent environment using USDC micropayments via x402.

## Known failure modes

- Contract address not verified on-chain — returns unverified or empty source
- Invalid or malformed address format — may return 4xx error
- Contract not found on the specified chain — empty or null response
- Rate limiting or payment failure via x402 protocol — 402 Payment Required if USDC payment not processed
- Network timeout if the underlying on-chain data provider is slow

## How this service works

Pay-per-call stock, macro, on-chain, and crypto data over the x402 protocol. USDC on Base or Solana, no API keys, no subscriptions.

## Output

A JSON object containing the contract's ABI (array of function/event definitions), chain identifier, contract address, whether it is a proxy, verification status, full Solidity source code, contract name, compiler version, whether optimization was used, and the implementation address if it is a proxy contract.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "required": {
   "type": "string"
  },
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "abi": [
   {
    "name": "someFunction",
    "type": "function",
    "inputs": [],
    "outputs": [],
    "constant": false
   }
  ],
  "chain": "eth",
  "address": "0xbb9bc244d798123fde783fcc1c72d3bb8c189413",
  "is_proxy": false,
  "verified": true,
  "source_code": "pragma solidity ^0.4.26;\n\ncontract Test12345 { ... }",
  "contract_name": "Test12345",
  "compiler_version": "v0.4.26+commit.4563c3fc",
  "optimization_used": true,
  "implementation_address": null
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/smart-contract-source-code-lookup-bb0de2ca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-stock-indicators.vercel.app](https://www.zero.xyz/host/x402-stock-indicators.vercel.app/llms.txt)
