# Onchain Contract Address & Function Selector Lookup

> Onchain Contract Address & Function Selector Lookup is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Resolves a 0x contract address or 4-byte function selector to on-chain metadata, ABI info, and risk/safety signals

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/crypto/contract
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchain-contract-address-function-selector-lookup-68bac74f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jDjHVHpLRjrMiWCmBPzEg

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 onchain-contract-address-function-selector-lookup-68bac74f -d '<json body>'
```

Example prompt: Can you look up the smart contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 and tell me what it is, what functions it exposes, and whether there are any risk flags on it?

## When to prefer this

Use this endpoint when an agent needs to programmatically resolve an unknown contract address or function selector to human-readable metadata and safety signals, especially as part of a pre-trade safety check or transaction decoding workflow. Prefer this over generic block explorers when you need structured, machine-readable output with integrated risk signals in a single pay-per-call API.

## Known failure modes

- Invalid hex input (not a valid 0x address or 4-byte selector) returns an error
- Unverified or obscure contract with no indexed ABI may return minimal metadata
- Network timeouts from underlying chain RPC nodes
- Address not yet indexed by the intelligence backend

## How this service works

Contract decoder: pass a verified 0x contract address to get its function ABI, or a 0x-selector (8 hex) to decode which function it is. Send { input }. Agents understand contracts before calling them.

## Output

Returns decoded contract or function selector information including contract name, ABI fragments, function signatures, and associated risk or safety signals for the queried address or selector.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "string",
   "description": "A 0x contract address (40 hex) or 0x function selector (8 hex)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchain-contract-address-function-selector-lookup-68bac74f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
