# Base Mainnet Contract Code Check

> Base Mainnet Contract Code Check is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-10).

Checks whether a Base mainnet address is a smart contract by retrieving its bytecode size via eth_getCode — returns zero for externally-owned accounts (EOAs).

## Facts

- Endpoint: GET https://x402.agentindex.world/base/code?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-mainnet-contract-code-check-d5d28130
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_05jzRsAOHm1lKTik9o_Xg

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 base-mainnet-contract-code-check-d5d28130
```

Example prompt: Is the address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base mainnet a smart contract or a regular wallet? Check its bytecode and tell me if it has deployed code.

## When to prefer this

Use this endpoint when you need a lightweight, single-call check to determine if a Base mainnet address is a smart contract versus a regular wallet, without needing full ABI decoding or contract interaction. It is faster and cheaper than fetching full transaction history and is ideal for pre-flight validation before token swaps, airdrops, or contract interactions on Base L2.

## Known failure modes

- Invalid or malformed Ethereum address returns an error
- Address not found on Base mainnet returns zero (indistinguishable from EOA at undeployed address)
- Network or RPC node errors may cause timeouts
- Payment failure via x402 protocol blocks the call

## How this service works

Check whether a Base mainnet address is a contract via eth_getCode - returns bytecode size, zero for an externally-owned account.

## Output

Returns the bytecode size (in bytes) for the given Base mainnet address — a non-zero value indicates a deployed smart contract, while zero indicates a plain externally-owned account (EOA) with no code.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "title": "Address"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-mainnet-contract-code-check-d5d28130/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
