# ABI Function/Event Selector Generator

> ABI Function/Event Selector Generator is a paid API for AI agents from x402-audit.tatschluizguilherme.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Computes the 4-byte function selector or 32-byte event topic0 from a human-readable Solidity signature using Keccak-256, with no RPC or API key required.

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/selector
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/abi-function-event-selector-generator-41bcb66d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RrE-508nvGxzTlxtAKGlk

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 abi-function-event-selector-generator-41bcb66d
```

Example prompt: What is the 4-byte selector for the Solidity function transfer(address,uint256)? Also verify it against the known decode dictionary.

## When to prefer this

Choose this endpoint when you need to compute Solidity function selectors or event topic0 hashes offline, without any RPC connection, blockchain node, or Etherscan API key. Ideal for agent workflows that need instant, deterministic ABI encoding — especially when building calldata, filtering event logs, or verifying function IDs in a chain-agnostic way.

## Known failure modes

- Malformed or invalid function signature returns a parse error
- Unsupported parameter syntax (e.g. nested tuples beyond spec) may cause incorrect output
- Missing kind field defaults to function selector; forgetting kind=event returns wrong hash length for events
- Non-canonical spacing or type aliases (uint vs uint256) may produce selector mismatch

## How this service works

Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.

## Output

Returns the 4-byte function selector (hex) or 32-byte event topic0 hash, along with the full keccak256 of the canonical signature, parsed input types, and a verification flag indicating whether the selector appears in the known /decode dictionary.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "kind": "function",
  "name": "transfer",
  "inputs": [
   {
    "name": "to",
    "type": "address"
   },
   {
    "name": "value",
    "type": "uint256"
   }
  ],
  "keccak": "0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b",
  "verify": {
   "args": [
    "address",
    "uint256"
   ],
   "name": "transfer",
   "known": true
  },
  "network": "offline",
  "selector": "0xa9059cbb",
  "signature": "transfer(address,uint256)",
  "requestedAt": "2026-08-05T09:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/abi-function-event-selector-generator-41bcb66d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-audit.tatschluizguilherme.workers.dev](https://www.zero.xyz/host/x402-audit.tatschluizguilherme.workers.dev/llms.txt)
