# Tereno Contract Change Detection

> Tereno Contract Change Detection 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).

Detects whether a Base smart contract has changed since the last Tereno observation, returning a decision-ready verdict (allow/review/block) and a diff of any bytecode or proxy changes

## Facts

- Endpoint: GET https://tereno.xyz/api/v1/capabilities/contract.change/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-change-detection-b58cbb26
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RJMt8MLASaKbEnuWUJb8n

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-change-detection-b58cbb26
```

Example prompt: Check if the Base contract at 0x1234567890abcdef1234567890abcdef12345678 has changed since Tereno last observed it and tell me whether it's safe to interact with.

## When to prefer this

Use this endpoint when an AI agent needs a pre-interaction safety check on a Base smart contract — especially before executing a transaction, approving a protocol, or integrating with a DeFi contract. It is ideal for change detection workflows where you want a cached, cost-efficient verdict rather than running raw RPC calls yourself. Prefer it over generic block explorers when you need a structured, decision-ready allow/review/block signal rather than raw blockchain data.

## Known failure modes

- Invalid or non-checksummed address format returns a 400 validation error
- Contract address not found on Base network may return empty or baseline-creation response
- Network congestion may cause delayed block data
- Expired or invalid quote ID returns a payment error
- Rate limiting or insufficient USDC payment triggers 402 Payment Required

## 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

A JSON object containing: a top-level `verdict` field (allow/review/block), a `result` object with `changed` boolean, an array of `changes` describing what differed, the `current` contract state (address, network, bytecodeHash, bytecodeBytes, proxy flag, admin, paused, implementation, computedAtBlock), a `baselineCreated` flag (true if this was the first observation), and `validUntilBlock` indicating result freshness. Also includes `pricing` details (USDC amount paid, cache status) and a `receiptUrl`.

## 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 compare with its previous Tereno observation."
      }
     },
     "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": [
        "changed",
        "baselineCreated",
        "changes",
        "current",
        "validUntilBlock"
       ],
       "properties": {
        "changed": {
         "type": "boolean"
        },
        "changes": {
         "type": "array"
        },
        "current": {
         "type": "object"
        },
        "baselineCreated": {
         "type": "boolean"
        },
        "validUntilBlock": {
         "type": "integer"
        }
       }
      },
      "pricing": {
       "type": "object"
      },
      "verdict": {
       "enum": [
        "allow",
        "review",
        "block"
       ]
      },
      "nextCall": {
       "type": [
        "object",
        "null"
       ]
      },
      "receiptUrl": {
       "type": "string"
      },
      "capabilityId": {
       "const": "contract.change"
      },
      "invocationId": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "changed": false,
   "changes": [],
   "current": {
    "admin": null,
    "proxy": false,
    "paused": false,
    "address": "0x1111111111111111111111111111111111111111",
    "network": "eip155:8453",
    "bytecodeHash": "0xabababababababababababababababababababababababababababababababab",
    "bytecodeBytes": 4096,
    "implementation": null,
    "computedAtBlock": 123456
   },
   "verdict": "allow",
   "baselineCreated": false,
   "validUntilBlock": 123456
  },
  "pricing": {
   "currency": "USDC",
   "listPriceUsd": 0.001,
   "pricePaidUsd": 0.001,
   "creditAppliedUsd": 0,
   "actualCacheStatus": "miss",
   "quotedCacheStatus": "miss"
  },
  "verdict": "allow",
  "nextCall": {
   "watch": null,
   "recheck": {
    "url": "https://www.tereno.xyz/api/v1/capabilities/contract.change/invoke?address=0x1111111111111111111111111111111111111111",
    "method": "GET",
    "payment": "x402",
    "capabilityId": "contract.change",
    "notBeforeBlock": 123462,
    "listPriceUsdCeiling": 0.002
   },
   "validForSeconds": 10,
   "validUntilBlock": 123461
  },
  "receiptUrl": "/api/v1/receipts/uuid",
  "capabilityId": "contract.change",
  "invocationId": "uuid",
  "capabilityVersion": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tereno-contract-change-detection-b58cbb26/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)
