# x402-audit Calldata Encoder

> x402-audit Calldata Encoder 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-10-03).

Encodes EVM function calls (by name or 4-byte selector + JSON arguments) into raw ABI-encoded calldata hex, with built-in round-trip decode verification, requiring no RPC or API key.

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/encode?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-audit-calldata-encoder-4b9af4fd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IOB3Zw4hGirfsMPhhqJWa

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 x402-audit-calldata-encoder-4b9af4fd
```

Example prompt: Encode the calldata for an ERC-20 transfer call — function name 'transfer', with recipient address 0xAbCd...1234 and amount 1000000 (as a JSON object) — and show me the resulting hex plus the round-trip verification so I can confirm what it will execute before I sign.

## When to prefer this

Choose this endpoint when you need to construct raw EVM calldata offline (no RPC, no blockchain access) for any of the ~40 common DeFi/ERC-20 functions, especially when you want immediate built-in verification via the round-trip decode. Prefer it over manual ABI encoding libraries when operating in an environment without Web3 tooling, or when you want a single HTTP call that both encodes and verifies correctness. Not suitable for arbitrary custom contract ABIs outside the built-in dictionary.

## Known failure modes

- Unknown function name not in the ~40-function dictionary returns an error — use the 4-byte selector instead
- Malformed JSON arguments (wrong types, missing required fields) return an encoding error
- Passing an invalid or unrecognized 4-byte selector with no matching ABI entry may fail or return partial data
- Providing positional array arguments in wrong order causes silent mis-encoding — round-trip verify field helps catch this
- Network errors to the Cloudflare Worker edge node may cause timeouts

## 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 a JSON object containing the raw ABI-encoded calldata hex string ready to use in a transaction, the 4-byte function selector, and a 'verify' field showing the decoded round-trip interpretation of the calldata (function name and resolved argument values) so the caller can confirm correctness before signing. No RPC connection or API key is required.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fn": "transfer",
  "args": {
   "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
   "value": "1000000"
  },
  "verify": {
   "args": [
    "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "1000000"
   ],
   "name": "transfer",
   "known": true,
   "nested": null,
   "argsNamed": {
    "to": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "value": "1000000"
   },
   "signature": "transfer(address,uint256)",
   "decodeError": false
  },
  "network": "offline",
  "calldata": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000f4240",
  "selector": "0xa9059cbb",
  "inputSize": 68,
  "signature": "transfer(address to, uint256 value)",
  "requestedAt": "2026-08-05T09:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-audit-calldata-encoder-4b9af4fd/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)
