{"uid":"cap_nc90x1HomstDoh-_bOSWS","slug":"abi-encode-decode-evm-calldata-builder-353c9674","name":"ABI Encode/Decode — EVM Calldata Builder","description":"ABI-encode a function call (selector + args) or encode/decode arbitrary ABI types — build and parse EVM calldata correctly.","url":"https://api.agentstools.dev/crypto/abi","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"op":{"enum":["encode_call","encode","decode"],"type":"string"},"args":{"type":"array","description":"Argument values for op=encode_call/encode"},"data":{"type":"string","description":"0x calldata/abi bytes for op=decode"},"types":{"type":"array","items":{"type":"string"},"description":"ABI type list for op=encode/decode"},"signature":{"type":"string","description":"Function signature for op=encode_call, e.g. transfer(address,uint256)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UJ5GParLmynGTVJQ8zUWG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"ABI-encode a Solidity function call (selector + args) or encode/decode arbitrary ABI types to build and parse EVM calldata correctly.","exampleAgentPrompt":"ABI-encode a function call to transfer(address,uint256) with args ['0xAbC123...', 1000000000000000000] so I have the correct EVM calldata hex to submit on-chain.","exampleUseCases":[{"title":"Build calldata for ERC-20 transfer","prompt":"Encode a call to the ERC-20 transfer function — signature is transfer(address,uint256) — with recipient 0xDEADBEEF000000000000000000000000DEADBEEF and amount 500000000000000000. Give me the full ABI-encoded calldata."},{"title":"Decode unknown transaction calldata","prompt":"I have this raw calldata from an on-chain tx: 0xa9059cbb000000000000000000000000deadbeef... — decode it using types [address, uint256] so I can see what arguments were passed."},{"title":"Encode arbitrary ABI types for off-chain use","prompt":"I need to ABI-encode a (bytes32, uint256, bool) tuple with values ['0xabc...', 42, true] — just encode the types without a function selector."}],"resultDescription":"Returns ABI-encoded hex string for encode/encode_call operations, or a structured array of decoded typed values for decode operations. For encode_call, includes the 4-byte function selector prepended to the encoded arguments.","failureModes":["Invalid function signature format — returns error if signature does not match Solidity ABI syntax","Mismatched argument count or types — fails if args array length doesn't match the signature's parameter list","Malformed 0x hex input for decode — error if data is not valid hex-encoded ABI bytes","Missing required fields (op, signature, types, args) — 400 error for incomplete requests","Type mismatch — encoding a string where uint256 is expected returns a type coercion error"],"whenToPreferThis":"Use this endpoint when an agent needs to programmatically construct or parse EVM calldata without a local Solidity/ethers.js environment — ideal for serverless agents that need to prepare raw transactions, verify calldata from on-chain events, or serialize arguments for multicall patterns. Prefer over manual encoding when correctness of ABI padding and selector computation is critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:55:03.635Z","isFirstParty":false}