# DeFi Safety Oracle – Contract Template Analysis

> DeFi Safety Oracle – Contract Template Analysis is a paid API for AI agents from oracle.cyberwarex.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Analyzes an ERC-20 token contract's code template to detect prior malice patterns, honeypot history, and scam rates across tokens sharing the same bytecode fingerprint.

## Facts

- Endpoint: GET https://oracle.cyberwarex.com/template?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-safety-oracle-contract-template-analysis-981d99e9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-qxYuWU3j_QgWk6WJK9sV

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 defi-safety-oracle-contract-template-analysis-981d99e9
```

Example prompt: Before I swap into this token, can you check if 0x4e9ce36e442e55ecd9025b9a6e0d88485d628a67 on Base is safe — look at its contract template history and tell me the malice rate and any reason codes?

## When to prefer this

Choose this endpoint when you need a fast, deterministic, pay-per-call token safety check grounded in real DEX pool simulation and cross-checked against GoPlus/honeypot.is — especially for Base or BSC tokens where template-level malice pattern analysis (not just token-level flags) adds signal. Prefer this over generic token info APIs when you specifically need honeypot simulation via eth_call state-override and bytecode fingerprint history.

## Known failure modes

- Invalid address format (must match ^0x[a-fA-F0-9]{40}$) — returns schema validation error
- Unsupported chain value — enum constraint rejects request
- Token contract not found or not yet indexed — available: false in response
- RPC or DEX simulation failure — upstream eth_call may time out or revert
- Payment not settled via x402 — 402 Payment Required response blocks the call
- Zero peer contracts found — low-confidence result with no malice data

## How this service works

Is this token safe to trade? Deterministic honeypot/rug simulation (eth_call state-override on real DEX pools: Aerodrome, Uniswap V2/V3/V4), contract-powers analysis, and GoPlus/honeypot.is cross-checks on Base & BSC. Grades A–F. Pay-per-call via x402 (USDC on Base, v1+v2 dual-stack).

## Output

Returns a JSON object with: the chain, the token address, a selector fingerprint identifying the contract template, total peer contracts sharing the template, counts of dead/malicious/powerful peers, a malice rate (0–1), a penalty score, an array of reason codes (e.g. TEMPLATE_PRIOR_MALICE, TEMPLATE_HIGH_MALICE_RATE), a human-readable summary, and an availability flag. Includes a disclaimer noting results are probabilistic priors, not definitive proof about the specific token.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "bsc",
        "ethereum",
        "polygon",
        "arbitrum",
        "robinhood"
       ],
       "type": "string",
       "default": "base"
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "ERC-20 token contract address."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "chain": {
       "type": "string"
      },
      "peers": {
       "type": "integer"
      },
      "address": {
       "type": "string"
      },
      "penalty": {
       "type": "integer"
      },
      "summary": {
       "type": "string"
      },
      "available": {
       "type": "boolean"
      },
      "dead_peers": {
       "type": "integer"
      },
      "malice_rate": {
       "type": "number"
      },
      "power_peers": {
       "type": "integer"
      },
      "selector_fp": {
       "type": "string"
      },
      "malice_peers": {
       "type": "integer"
      },
      "reason_codes": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "selector_count": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "peers": 16,
  "address": "0x0000000000000000000000000000000000000abc",
  "penalty": 40,
  "summary": "8 of 16 tokens sharing this code template were honeypots/scams (50% malice-rate).",
  "available": true,
  "dead_peers": 3,
  "disclaimer": "Prior about the contract template from our own history; not proof about this token.",
  "malice_rate": 0.5,
  "power_peers": 1,
  "selector_fp": "a1b2c3d4e5f60718",
  "malice_peers": 8,
  "reason_codes": [
   "TEMPLATE_PRIOR_MALICE",
   "TEMPLATE_HIGH_MALICE_RATE"
  ],
  "selector_count": 41
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-safety-oracle-contract-template-analysis-981d99e9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from oracle.cyberwarex.com](https://www.zero.xyz/host/oracle.cyberwarex.com/llms.txt)
