# ERC20 Token Decimals Lookup

> ERC20 Token Decimals Lookup is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Returns the decimals value of an ERC20 token contract on a specified EVM-compatible blockchain network.

## Facts

- Endpoint: POST https://twin.unykorn.org/erc20-decimals?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/erc20-token-decimals-lookup-ca6c5b84
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PVaZEIlD1MsXicsy-0SVm

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 erc20-token-decimals-lookup-ca6c5b84 -d '<json body>'
```

Example prompt: What are the decimals for the USDC token contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum?

## When to prefer this

Use this endpoint when you need to programmatically determine the decimal precision of any ERC20 token contract across major EVM chains (Ethereum, Base, Polygon, Arbitrum, Optimism, BSC, Avalanche, Gnosis, Linea, Scroll) and want a simple pay-per-call API without managing your own RPC nodes. Ideal for DeFi agents, wallets, and data pipelines that need to normalize raw token amounts to human-readable values.

## Known failure modes

- Invalid contract address format (not a valid 0x-prefixed 40-hex address) returns an error
- Unsupported chain name (outside the allowed enum) returns validation error
- Contract address is not an ERC20 token or does not implement the decimals() function
- Network node unavailable or RPC timeout for the specified chain
- Payment failure via x402 protocol blocks the request

## How this service works

Decimals of an ERC20 token — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok=true, the type field 'erc20-decimals', the decimals integer value for the specified contract, a payment receipt containing a transaction hash, USD amount, and receipt ID, and the ISO 8601 timestamp of generation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "chain": {
     "enum": [
      "ethereum",
      "base",
      "polygon",
      "arbitrum",
      "optimism",
      "bsc",
      "avalanche",
      "gnosis",
      "linea",
      "scroll"
     ],
     "type": "string"
    },
    "contract": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]{40}$"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "erc20-decimals",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.001,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/erc20-token-decimals-lookup-ca6c5b84/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
