# Base Onchain Contract Code Safety Scanner

> Base Onchain Contract Code Safety Scanner is a paid API for AI agents from x402-data-api.bodhinindustries.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Analyzes a Base blockchain address's deployed bytecode to detect proxy patterns, upgrade risks, dangerous opcodes, and contract safety flags — computed live from raw chain data with no third-party dependencies.

## Facts

- Endpoint: GET https://x402-data-api.bodhinindustries.workers.dev/code
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-onchain-contract-code-safety-scanner-c203bdd6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8g1DYH4eR1TZ5wBZZ5o9J

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-onchain-contract-code-safety-scanner-c203bdd6
```

Example prompt: Can you scan the Base contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 and tell me if it's a proxy, whether it has any dangerous opcodes like SELFDESTRUCT or DELEGATECALL, and what the overall safety verdict is?

## When to prefer this

Choose this endpoint when you need trustless, first-party smart contract bytecode analysis on Base with no reliance on third-party indexers or off-chain data. Ideal for DeFi agents performing pre-interaction safety checks, wallet risk audits, or token triage where proxy detection, dangerous opcode scanning, and upgradeability verification are critical. Prefer over block explorer APIs when you need raw, manipulation-resistant chain-computed results.

## Known failure modes

- Invalid or malformed address returns an error response
- Address not found on Base returns isContract: false with no bytecode data
- Network RPC errors may cause timeouts on congested Base chain
- Non-Base chain addresses will return incorrect or empty results since only Base is supported
- Unverified or obfuscated proxy patterns may not be detected

## How this service works

Self-computed Base onchain toolkit for AI agents: ERC-20 safety scan, manipulation-resistant TWAP price oracle, gas/fee oracle, calldata decoder, token/address/contract intel, wallet approval-risk audit, and batch token triage — all computed live from raw Base chain, no third-party data.

## Output

Returns a JSON object with the inspected address, whether it's a contract or EOA, proxy type (uups/transparent/beacon/eip1167-minimal), upgradeability status, implementation address if proxied, presence of DELEGATECALL and SELFDESTRUCT opcodes, bytecode keccak256 hash, code size, array of risk flags, a verdict string (eoa/plain/caution), and an ISO-8601 timestamp — all computed directly from Base chain with thirdPartyDataUsed always false.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "address"
 ],
 "properties": {
  "token": {
   "type": "string",
   "description": "Alias for address (agent ergonomics)."
  },
  "address": {
   "type": "string",
   "description": "Base address to inspect (token alias also accepted)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "description": "address inspected"
  },
  "isProxy": {
   "type": "boolean",
   "description": "proxy detected"
  },
  "verdict": {
   "type": "string",
   "description": "eoa|plain|caution"
  },
  "codeHash": {
   "type": "string",
   "description": "keccak256 of bytecode"
  },
  "proxyType": {
   "type": "string",
   "description": "uups|transparent|beacon|eip1167-minimal|null"
  },
  "riskFlags": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "computedAt": {
   "type": "string",
   "description": "ISO-8601 timestamp"
  },
  "isContract": {
   "type": "boolean",
   "description": "has bytecode"
  },
  "upgradeable": {
   "type": "boolean",
   "description": "implementation can change"
  },
  "codeSizeBytes": {
   "type": "integer",
   "description": "deployed code size"
  },
  "hasDelegatecall": {
   "type": "boolean",
   "description": "DELEGATECALL opcode present"
  },
  "hasSelfdestruct": {
   "type": "boolean",
   "description": "SELFDESTRUCT opcode present"
  },
  "thirdPartyDataUsed": {
   "type": "boolean",
   "description": "always false"
  },
  "implementationAddress": {
   "type": "string",
   "description": "resolved implementation (or null)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-onchain-contract-code-safety-scanner-c203bdd6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-data-api.bodhinindustries.workers.dev](https://www.zero.xyz/host/x402-data-api.bodhinindustries.workers.dev/llms.txt)
