# Contract Risk API (and companion routes) Pre-trade safety checks for smart contracts and tokens. Three POST routes, all x402 "exact" scheme, USDC on eip155:8453, payTo 0x9899E88bB5263d04e310daFEf99c77Fb55413623. Mode: paid ## POST https://contract-risk-api-six.vercel.app/v1/scan — risk score — $0.02 On-chain contract risk score: detects upgradeable proxies and privileged functions from live bytecode. Use before trading/interacting with an unfamiliar contract. Request body (application/json): { "address": "0x...", "chain": "base" | "ethereum" } Example request: {"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","chain":"base"} Example response: {"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","chain":"base","riskLevel":"low","riskScore":0} How to read riskScore: the sum of the weights of every risk signal found in the contract's live bytecode and its EIP-1967 proxy slot. riskLevel bands it: low 0-9, medium 10-29, high 30+, and "unknown" when the address holds no code. Max score 105. Weights: upgradeable proxy +10, owner() +5, transferOwnership(address) +5, mint(address,uint256) +15, pause() +10, blacklist(address) +20, setBlacklist(address,bool) +20, excludeFromFee(address) +5, setTaxFee(uint256) +15. A high score is not proof of malice and a low score is not a guarantee — it measures how much power the owner holds, not their intent. Detection is a bytecode heuristic and only reads the EIP-1967 proxy slot, so it can under-report on optimised bytecode and on older proxy layouts. ## POST https://contract-risk-api-six.vercel.app/v1/alert-check — Telegram alert-channel monitor — $0.03 Telegram alert-channel monitoring for a contract address or ticker: returns mention volume across tracked crypto channels, categorized into security alerts, whale movements, and listing/news. Use alongside an on-chain risk scan — a contract with a high risk score that is also being flagged by a security channel is a materially different signal. Request body (application/json): { "address": "0x... or a ticker like USDC", "chain": "base" | "ethereum" } Example request: {"address":"USDC","chain":"base"} Example response: {"query":"USDC","chain":"base","alertMentions":14,"categories":{"securityAlert":0,"whaleMovement":14,"listing":0,"other":0},"channels":["whale_alert","whale_alert_io"],"lastCheckedAt":"2026-10-14T12:19:44.073Z"} How to read alertMentions: it counts appearances in the *current rolling window* — the last 30 messages per tracked channel, cached for up to 15 minutes. securityAlert=0 means "no security-channel mentions in the current window", NOT "never flagged." Absence of alerts is not a safety guarantee. Categories: securityAlert, whaleMovement, listing, other. lastCheckedAt reports the scan timestamp, so a caller can reason about freshness. ## POST https://contract-risk-api-six.vercel.app/v1/full-check — combined pre-trade check — $0.04 Combined pre-trade safety check: on-chain risk score (proxy + privileged-function detection from live bytecode) plus Telegram alert-channel monitoring, in one call. Cheaper than calling /v1/scan and /v1/alert-check separately ($0.04 vs $0.05), and the two signals are worth more together — a contract with privileged functions that is also being flagged in a security channel is a different situation than either signal alone. Request body (application/json): { "address": "0x...", "chain": "base" | "ethereum" } Example request: {"address":"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA","chain":"base"} Example response: {"address":"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA","chain":"base","risk":{"isContract":true,"isProxy":true,"flags":[{"label":"upgradeable proxy (EIP-1967) — logic can be swapped by admin","weight":10}],"riskScore":10,"riskLevel":"medium"},"alerts":{"alertMentions":0,"categories":{"securityAlert":0,"whaleMovement":0,"listing":0,"other":0},"channels":[],"note":"No mentions in the current rolling window (last 30 messages per tracked channel). Absence of alerts is not a safety guarantee."}} Returns { address, chain, risk: , alerts: } in one call. $0.04 vs $0.05 for the two routes separately. ## Verifying a paid response Every 402 response carries a signed **offer** in extensions["offer-receipt"].info.offers — one per accepted payment option, each committing to resourceUrl, scheme, network, asset, payTo, amount and validUntil, signed with EIP-712. Every 200 response carries: 1. A signed **receipt** in extensions["offer-receipt"].info.receipt — an EIP-712 signature over { version, network, resourceUrl, payer, issuedAt }. This proves which service produced the response, for which payer, at what time. 2. The **settlement transaction hash** at the TOP LEVEL of the same header (fields: success, payer, transaction, network). This is the standard x402 envelope, separate from the signed receipt. To verify end-to-end: a. Base64-decode the PAYMENT-RESPONSE header. b. Recover the EIP-712 signer from extensions["offer-receipt"].info.receipt and compare to https://contract-risk-api-six.vercel.app/.well-known/x402 -> signing.address (currently 0xe0cE2Ac8dfFAf4AD6d975E460F59a7b182e54C71). c. Confirm the top-level "transaction" field exists on-chain (basescan), from "payer" to the offer's payTo, in the offered amount. What this proves: the response was produced by this service, for this payer, at the stated time; and that settlement for that payer occurred on-chain at the stated transaction hash. What it does NOT prove: that the underlying on-chain or Telegram data is correct. A signature answers "who said this, and when" — not "is it true". Treat it as a resolvable audit trail, not a safety score. ## GET https://contract-risk-api-six.vercel.app/app Browser UI: connect an EVM wallet, pay with USDC on Base, read the scan. https://contract-risk-api-six.vercel.app/ redirects here. ## GET https://contract-risk-api-six.vercel.app/health Free liveness check, no payment required. ## Machine-readable surfaces https://contract-risk-api-six.vercel.app/.well-known/x402 https://contract-risk-api-six.vercel.app/openapi.json