# WritersLogic Calldata Decode

> WritersLogic Calldata Decode is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Decodes Ethereum hex calldata, return data, revert data, or event logs against a caller-supplied ABI using ethers, with strict re-encode validation.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/calldata-decode?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-calldata-decode-567e91a6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_taa_w7BB1OD03lcfcXagA

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 writerslogic-calldata-decode-567e91a6 -d '<json body>'
```

Example prompt: I have this raw hex calldata from a transaction I'm about to sign — can you decode it against this ABI so I can see exactly which function is being called and what the arguments are? The data is 0xa9059cbb000000000000000000000000deadbeef...0000000000000000000000000000000000000000000000000de0b6b3a7640000 and the mode is 'call'.

## When to prefer this

Use this endpoint when an AI agent needs to decode Ethereum transaction calldata, return data, revert data, or event logs purely from a caller-supplied ABI — especially when you need strict validation of encoding correctness (trailing bytes, dirty padding, non-canonical offsets). Prefer this over on-chain simulators or block explorers when you want a fast, deterministic, offline decode without network calls or ABI fetching. It is ideal for pre-sign transaction inspection workflows and post-failure revert analysis where you already have the ABI.

## Known failure modes

- Selector not present in provided ABI — returns unknown status
- Malformed or non-0x-prefixed hex data — returns parse error
- ABI fragments that don't match the data structure — decode mismatch error
- Trailing bytes or dirty padding detected — flagged as validation warning but still decoded
- Missing required 'function' field when mode is 'return' — validation error
- Data exceeds 20,000 byte limit — rejected with size error
- Empty or missing ABI array — rejected with schema validation error

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns the decoded fields as named parameters with their values and types, plus any strict re-encode validation warnings such as trailing bytes, dirty padding, or non-canonical offsets. If the selector is not found in the provided ABI, the endpoint returns an 'unknown' status rather than an error.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "abi": {
   "type": "array",
   "items": {
    "description": "JSON ABI fragment object or human-readable signature string."
   },
   "maxItems": 200,
   "minItems": 1,
   "description": "Fragments of the contract ABI (JSON objects or human-readable strings)."
  },
  "data": {
   "type": "string",
   "maxLength": 40002,
   "description": "0x-prefixed hex, whole bytes; up to 20000 bytes."
  },
  "mode": {
   "enum": [
    "call",
    "return",
    "error",
    "event"
   ],
   "type": "string",
   "description": "Default call: data is selector plus arguments."
  },
  "topics": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 66
   },
   "maxItems": 4,
   "description": "mode event: 0x topics, topic0 first."
  },
  "function": {
   "type": "string",
   "maxLength": 200,
   "description": "mode return: function name or signature."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-calldata-decode-567e91a6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
