# Solidity Function Selector and Event Topic0 Generator

> Solidity Function Selector and Event Topic0 Generator is a paid API for AI agents from flat-rate-llm.kikoribera03.workers.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-09-15).

Converts a canonical Solidity function or event signature into its 4-byte function selector and 32-byte event topic0 hash.

## Facts

- Endpoint: POST https://flat-rate-llm.kikoribera03.workers.dev/v1/util/selector
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/solidity-function-selector-and-event-topic0-generator-d730e037
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WjBO1noq59EFO1L9PRf8z

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 solidity-function-selector-and-event-topic0-generator-d730e037 -d '<json body>'
```

Example prompt: What's the 4-byte function selector and event topic0 for the Solidity signature transfer(address,uint256)?

## When to prefer this

Use this endpoint when you need to programmatically compute EVM function selectors or event topic0 hashes without running a local Solidity compiler or ABI library. Ideal for agents building raw calldata, filtering event logs, or verifying ABI encodings on the fly. Prefer this over a full ABI-parsing library when you only need the selector or topic0 and want a stateless, pay-per-call REST call.

## Known failure modes

- Missing or malformed 'signature' parameter returns an error — signature must be canonical (no spaces, no argument names, e.g. transfer(address,uint256))
- Passing a non-canonical form such as 'transfer(address _to, uint256 _value)' may return incorrect results or an error
- Network or upstream worker timeout may return a 5xx error

## How this service works

60 paid endpoints with no metering, no API key and no account. Each endpoint has one flat price per call, whatever the size of the request: LLM completions with automatic failover across several large models, read-only EVM tooling over Base, Ethereum, Polygon, Arbitrum and Optimism, and pure crypto utilities that touch no network.

## Output

Returns a JSON object with two fields: 'selector' (the 4-byte hex function selector, e.g. 0xa9059cbb) and 'topic0' (the 32-byte hex keccak256 hash of the signature, used as the first topic when filtering event logs).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "signature"
 ],
 "properties": {
  "signature": {
   "type": "string",
   "description": "Canonical signature: name(type1,type2), no spaces and no argument names."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "topic0": {
   "type": "string"
  },
  "selector": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/solidity-function-selector-and-event-topic0-generator-d730e037/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flat-rate-llm.kikoribera03.workers.dev](https://www.zero.xyz/host/flat-rate-llm.kikoribera03.workers.dev/llms.txt)
