Decode EVM calldata, return data, revert data or event logs against an ABI
Decodes hex calldata (selector plus arguments), function return data, revert data or an event log against a caller-supplied ABI using ethers, for agents inspecting a transaction before signing or after it fails. Handles tuples, nested and dynamic arrays, bytes and strings, and the built-in Error(string) and Panic(uint256) reverts; a strict re-encode check flags trailing bytes, dirty padding and non-canonical offsets. Does not look up unknown selectors, fetch ABIs, simulate the call or judge whether the transaction is safe; a selector missing from the ABI returns unknown.
What you get
A 'transfer' that is really an approval to an attacker is visible once the calldata is decoded.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/calldata-decode. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/calldata-decode \
-H 'content-type: application/json' \
-d '{"abi":["function transfer(address to, uint256 amount) returns (bool)"],"data":"0xa9059cbb000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000005"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
abi | array<any>; max 200 items | yes | Fragments of the contract ABI (JSON objects or human-readable strings). |
mode | string; one of "call", "return", "error", "event" | no | Default call: data is selector plus arguments. |
data | string; length 0..40002 | yes | 0x-prefixed hex, whole bytes; up to 20000 bytes. |
function | string; length 0..200 | no | mode return: function name or signature. |
topics | array<string; length 0..66>; max 4 items | no | mode event: 0x topics, topic0 first. |
Example request body
{
"abi": [
"function transfer(address to, uint256 amount) returns (bool)"
],
"data": "0xa9059cbb000000000000000000000000000000000000000000000000000000000000dead0000000000000000000000000000000000000000000000000000000000000005"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
mode | string | no | |
selector | string | no | |
signature | string | no | |
name | string | no | |
args | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the code-preflight-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent