# Base Contract ABI Reverse-Engineer & Interface Detector

> Base Contract ABI Reverse-Engineer & Interface Detector 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-14).

Recovers 4-byte function selectors from a Base contract's bytecode and resolves them to human-readable signatures, guessing the implemented ERC interface (ERC-20, ERC-721, ERC-4626, etc.)

## Facts

- Endpoint: GET https://x402-data-api.bodhinindustries.workers.dev/abi
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-contract-abi-reverse-engineer-interface-detector-ebec73ec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EPyVNygFxUMmpNO39_jpW

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-contract-abi-reverse-engineer-interface-detector-ebec73ec
```

Example prompt: Can you reverse-engineer the ABI of this Base contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 — resolve the selectors to real function names and tell me what ERC interface it looks like it implements? Also follow the proxy if there is one.

## When to prefer this

Use this endpoint when you need to inspect an unverified or unknown Base contract's callable functions without access to a verified ABI. Ideal for auditing proxy contracts, identifying ERC token standards from bytecode alone, or reverse-engineering contract interfaces without relying on Etherscan or other third-party indexers. Prefer this over Etherscan ABI lookups when the contract is unverified or when you want trustless, on-chain-derived data.

## Known failure modes

- Address is an EOA (wallet), not a contract — isContract returns false, no selectors
- Invalid or malformed address string — likely 400-level error
- Contract has no recoverable selectors (e.g. minimal proxy with no public functions)
- 4byte resolution unavailable or returns no matches — resolved flag is false for those selectors
- Payment not included or insufficient — 402 Payment Required

## 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 list of recovered 4-byte function selectors with resolved human-readable signatures (via 4byte.directory), a best-guess ERC interface label (e.g. erc20, erc721, erc4626), total selector count, a boolean indicating whether the address has contract bytecode, the Base block height at computation time, and an ISO-8601 timestamp. Includes a flag indicating whether any third-party data (4byte resolution) was used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "address"
 ],
 "properties": {
  "address": {
   "type": "string",
   "description": "Base contract to reverse-engineer (alias: contract)."
  },
  "resolve": {
   "type": "string",
   "description": "Resolve selectors to names via 4byte: 'true' (default) or 'false'."
  },
  "followProxy": {
   "type": "string",
   "description": "Also merge the implementation's selectors if the target is a proxy: 'true' or 'false' (default)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "block": {
   "type": "integer",
   "description": "Base block height"
  },
  "address": {
   "type": "string",
   "description": "contract"
  },
  "functions": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "resolved": {
      "type": "boolean",
      "description": "resolved via 4byte"
     },
     "selector": {
      "type": "string",
      "description": "4-byte selector"
     },
     "signatures": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "primarySignature": {
      "type": "string",
      "description": "canonical signature (or null)"
     }
    }
   }
  },
  "computedAt": {
   "type": "string",
   "description": "ISO-8601 timestamp"
  },
  "isContract": {
   "type": "boolean",
   "description": "has bytecode"
  },
  "selectorCount": {
   "type": "integer",
   "description": "unique selectors recovered"
  },
  "interfaceGuess": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "e.g. erc20, erc721, erc4626"
  },
  "thirdPartyDataUsed": {
   "type": "boolean",
   "description": "true when resolve!=false"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-contract-abi-reverse-engineer-interface-detector-ebec73ec/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)
