# P0 Agent Economy Index – EVM Contract Code Lookup

> P0 Agent Economy Index – EVM Contract Code Lookup is a paid API for AI agents from x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-20).

Fetches on-chain bytecode, contract status, and EIP-1967 proxy implementation for any EVM address on supported chains

## Facts

- Endpoint: GET https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/evm/code?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/p0-agent-economy-index-evm-contract-code-lookup-20563c21
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ssq-REc6MGUL8RmbVxRD3

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 p0-agent-economy-index-evm-contract-code-lookup-20563c21
```

Example prompt: Is the address 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 a smart contract on Base, and if it's a proxy, what implementation does it point to?

## When to prefer this

Use this endpoint when you need a direct, uncached, real-time read of on-chain contract code metadata for EVM addresses across Ethereum, Base, Arbitrum, Polygon, or Optimism — especially to distinguish contracts from EOAs, audit deployed bytecode, or resolve EIP-1967 proxy implementations. Prefer this over block explorer APIs when you need a receipt-grade snapshot with an explicit block number and source node, or when operating in the x402 micropayment ecosystem.

## Known failure modes

- Invalid address format (not a 40-hex 0x address) returns validation error
- Unsupported chain value returns enum error
- Public node unavailable or rate-limited: affected fields appear as null and named in errors array
- EOA address returns is_contract=false, code_bytes=0, code_sha256=null
- No EIP-1967 slot found: eip1967_implementation=null

## How this service works

An open index of the machine-to-machine (agent) economy. x402 routes: ranked discovery over the live x402 service market, every indexed service scored by real 30-day calls and paying-wallet bounds, with a receipt naming the snapshot hash and scoring revision. /economy routes, for Tempo MPP, Virtuals ACP, Olas, Masumi, ERC-8004 agent registries, Solana agent registries, Base agent contracts and MCP servers (Official MCP Registry): each protocol's published figures (agent or server counts, transactions or payment events; payers and USD volume only where the source publishes them: payers for x402 and Tempo MPP, USD volume for x402 and Virtuals ACP), each with its unit, window and source; units differ, so totals are not summed. L402 and per-service MPP listings are not covered.

## Output

Returns a JSON object with: chain name and chain ID, latest block number at time of query, ISO 8601 timestamp, the queried address, whether it is a contract (is_contract boolean), bytecode size in bytes (code_bytes), sha256 hash of bytecode (null for EOAs), EIP-1967 implementation slot address if present, the public node hostname that answered (source), and a list of any fields the node failed to return (errors). No caching, no USD pricing.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "ethereum",
        "base",
        "arbitrum",
        "polygon",
        "optimism"
       ],
       "type": "string",
       "default": "base",
       "description": "Chain; default base"
      },
      "address": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "0x address (40 hex)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "chain",
      "chainId",
      "block",
      "as_of",
      "errors",
      "note",
      "address",
      "is_contract",
      "code_bytes"
     ],
     "properties": {
      "note": {
       "type": "string",
       "description": "Fixed text: read from a public node, no USD prices"
      },
      "as_of": {
       "type": "string",
       "description": "ISO 8601 UTC time of the reply"
      },
      "block": {
       "type": [
        "integer",
        "null"
       ],
       "description": "Latest block at the node when it answered"
      },
      "chain": {
       "enum": [
        "ethereum",
        "base",
        "arbitrum",
        "polygon",
        "optimism"
       ],
       "type": "string",
       "description": "Chain key"
      },
      "errors": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "description": "Calls or fields the node did not return"
      },
      "source": {
       "type": [
        "string",
        "null"
       ],
       "description": "Public node host that answered"
      },
      "address": {
       "type": "string"
      },
      "chainId": {
       "type": "integer",
       "description": "EVM chain id"
      },
      "code_bytes": {
       "type": "integer"
      },
      "code_sha256": {
       "type": [
        "string",
        "null"
       ],
       "description
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Read directly from a public node at the block shown; nothing is cached, estimated or priced in USD. A field the node did not return is null and named in errors.",
  "as_of": "2026-10-19T12:00:00.000Z",
  "block": 52207800,
  "chain": "base",
  "errors": [],
  "source": "base.drpc.org",
  "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "chainId": 8453,
  "code_bytes": 1852,
  "code_sha256": "9b2f1c0e5d4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c",
  "is_contract": true,
  "eip7702_delegate": null,
  "eip1967_implementation": null
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/p0-agent-economy-index-evm-contract-code-lookup-20563c21/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev](https://www.zero.xyz/host/x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/llms.txt)
