{"uid":"cap_4ZkSo7KV-HN3GCvCxqomr","slug":"abi-decode-return-data-against-declared-types-b93dab5e","name":"ABI-Decode Return Data Against Declared Types","description":"ABI-decode return data against declared types — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/abi-decode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"types":{}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"abi-decode","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Fer1WTM_LuZ1jQTVef0g4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decodes raw ABI-encoded hex data into human-readable values given a list of Solidity types","exampleAgentPrompt":"Decode this ABI-encoded hex string for me — 0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045 — it should be a single address type.","exampleUseCases":[{"title":"Parse contract call return value","prompt":"I just called a smart contract and got back this raw hex: 0x0000000000000000000000000000000000000000000000000de0b6b3a7640000 — can you decode it as a uint256 so I can see the actual number?"},{"title":"Decode multi-value tuple response","prompt":"My contract returned this ABI-encoded blob: 0x00000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045 — decode it as (uint256, address) please."},{"title":"Interpret encoded event log data","prompt":"I have raw event log data from an ERC20 Transfer event: 0x0000000000000000000000000000000000000000000000056bc75e2d63100000 — decode it as uint256 to get the token amount transferred."}],"resultDescription":"Returns a JSON object with ok: true, the decoded values corresponding to the provided types, a receipt containing a transaction hash, USD amount paid, and a unique receipt ID, plus a generated_at ISO8601 timestamp.","failureModes":["Invalid or malformed 0x hex data returns an error response","Mismatch between data length and declared types causes decode failure","Unsupported or unrecognized Solidity types may result in errors","Empty or missing data field returns a validation error","Hex string not padded to 32-byte word boundaries may fail to decode"],"whenToPreferThis":"Choose this endpoint when you have raw ABI-encoded hex data returned from an EVM smart contract call, transaction, or event log and need to convert it into typed, human-readable values without setting up a local Web3 library. Ideal for agents operating in environments where ethers.js or web3.py is unavailable, or when you need a lightweight, pay-per-call decoding step in a larger blockchain automation workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:42.094Z","isFirstParty":false,"canonicalSlug":"abi-decode-return-data-against-declared-types-b93dab5e"}