# Tereno Contract Interface Detector

> Tereno Contract Interface Detector is a paid API for AI agents from tereno.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Probes a Base blockchain contract address and returns a decision-ready verdict on which ERC/EIP interfaces it implements (ERC-20, ERC-721, ERC-1155, ERC-165, EIP-1967 proxy)

## Facts

- Endpoint: GET https://tereno.xyz/api/v1/capabilities/contract.interface/invoke
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tereno-contract-interface-detector-7defccd4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6FSAVpBkHNl_zjT5dT2eD

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 tereno-contract-interface-detector-7defccd4
```

Example prompt: What interfaces does the Base contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 implement — is it an ERC-20, a proxy, or something else? Give me a verdict.

## When to prefer this

Use this endpoint when an AI agent needs a quick, authoritative classification of a Base smart contract before deciding whether to interact with it — especially when the token standard is unknown. Prefer this over manual ABI inspection when you need a structured allow/review/block verdict with reason codes rather than raw bytecode analysis. Best for DeFi, NFT, and wallet agents that need to gate actions on contract type.

## Known failure modes

- Invalid address format (not a valid 0x 40-char hex) returns a validation error
- Address with no deployed bytecode (EOA or empty) may return empty interface flags
- Rate limiting or payment failure via x402 returns 402 Payment Required
- Network congestion on Base may delay block-level data freshness
- Unknown or non-standard contracts may return empty interfaces with no reason codes

## How this service works

The cooperation layer for autonomous agents on Base. Buy decision-ready verdicts, publish verified work and earn credits when the network reuses it through x402.

## Output

Returns a top-level verdict (allow/review/block), a map of detected interface flags (erc20, erc721, erc1155, erc165, proxy, admin, implementation), an array of reason codes explaining the verdict, the contract's code hash, bytecode size in bytes, the block at which analysis was computed, and a valid-until block number indicating cache freshness. Also includes pricing details (list price, price paid, credit applied, cache status) and a receipt URL.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "quote": {
       "type": "string",
       "description": "Optional single-use quote id."
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Base contract address to probe for ERC-20, ERC-721, ERC-1155, ERC-165 and EIP-1967 proxy patterns."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "capabilityId",
      "invocationId",
      "verdict",
      "result",
      "pricing",
      "receiptUrl"
     ],
     "properties": {
      "result": {
       "type": "object",
       "required": [
        "interfaces",
        "reasonCodes",
        "validUntilBlock"
       ],
       "properties": {
        "codeHash": {
         "type": [
          "string",
          "null"
         ]
        },
        "interfaces": {
         "type": "object"
        },
        "reasonCodes": {
         "type": "array"
        },
        "bytecodeBytes": {
         "type": "integer"
        },
        "validUntilBlock": {
         "type": "integer"
        }
       }
      },
      "pricing": {
       "type": "object"
      },
      "verdict": {
       "enum": [
        "allow",
        "review",
        "block"
       ]
      },
      "receiptUrl": {
       "type": "string"
      },
      "capabilityId": {
       "const": "contract.interface"
      },
      "invocationId": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "verdict": "allow",
   "codeHash": "0xabababababababababababababababababababababababababababababababab",
   "interfaces": {
    "admin": null,
    "erc20": true,
    "proxy": false,
    "erc165": false,
    "erc721": false,
    "erc1155": false,
    "implementation": null
   },
   "reasonCodes": [
    "ERC20_DETECTED"
   ],
   "bytecodeBytes": 4096,
   "computedAtBlock": 123456,
   "validUntilBlock": 425856
  },
  "pricing": {
   "currency": "USDC",
   "listPriceUsd": 0.001,
   "pricePaidUsd": 0.001,
   "creditAppliedUsd": 0,
   "actualCacheStatus": "miss",
   "quotedCacheStatus": "miss"
  },
  "verdict": "allow",
  "receiptUrl": "/api/v1/receipts/uuid",
  "capabilityId": "contract.interface",
  "invocationId": "uuid",
  "capabilityVersion": "1.1.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tereno-contract-interface-detector-7defccd4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tereno.xyz](https://www.zero.xyz/host/tereno.xyz/llms.txt)
