Decode EVM calldata, return data, revert data or event logs against an ABI

$0.005 USDC per call · Developer and security · POST /api/v1/calldata-decode · Id calldata-decode

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

FieldTypeRequiredDescription
abiarray<any>; max 200 itemsyesFragments of the contract ABI (JSON objects or human-readable strings).
modestring; one of "call", "return", "error", "event"noDefault call: data is selector plus arguments.
datastring; length 0..40002yes0x-prefixed hex, whole bytes; up to 20000 bytes.
functionstring; length 0..200nomode return: function name or signature.
topicsarray<string; length 0..66>; max 4 itemsnomode 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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
modestringno
selectorstringno
signaturestringno
namestringno
argsarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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