{"uid":"cap_viPxCfq_NfW_JpX74CVpi","slug":"saylor-innovations-abi-encode-call-e75d6e23","name":"Saylor Innovations ABI Encode Call","description":"Encode a contract call: give a function signature and a JSON array of arguments, get calldata and the 4-byte selector. Computed locally, no node needed.","url":"https://saylorinnovations.com/api/chain/encode-call?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["signature","args"],"properties":{"args":{"type":"string","description":"the arguments as a JSON array, for example [\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"1000000\"]"},"signature":{"type":"string","description":"the function signature with types only, for example transfer(address,uint256)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["signature","selector","calldata","calldata_bytes","note","source"],"properties":{"note":{"type":"string","description":"plain-language reading of the result"},"source":{"type":"string","description":"where the data was read from or how it was computed"},"calldata":{"type":"string","description":"selector plus ABI-encoded arguments"},"selector":{"type":"string","description":"4-byte function selector"},"signature":{"type":"string","description":"the signature that was encoded"},"argument_types":{"type":["array","null"],"description":"types parsed from the signature"},"calldata_bytes":{"type":"number","description":"length of the calldata"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_CRX__Xz-pP_NGcDDpGIwt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes an EVM contract function call into ABI calldata and returns the 4-byte selector, computed locally without a node","exampleAgentPrompt":"Can you encode a contract call for the ERC-20 transfer function — signature is transfer(address,uint256) and the arguments are [\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"1000000\"] — I need the calldata and the 4-byte selector?","exampleUseCases":[{"title":"Build raw ERC-20 transfer calldata","prompt":"I need to manually construct a raw Ethereum transaction to call transfer on an ERC-20 token. The function signature is transfer(address,uint256) and the args are [\"0xAbCd1234abcd1234abcd1234abcd1234AbCd1234\", \"500000000000000000\"]. Can you give me the full calldata and selector?"},{"title":"Verify function selector matches expected","prompt":"What is the 4-byte selector for the function signature approve(address,uint256)? I want to double-check it matches 0x095ea7b3 before I send a transaction."},{"title":"Encode multicall payload offline","prompt":"I'm building a multicall batch and need calldata for swapExactTokensForTokens(uint256,uint256,address[],address,uint256) with args [\"1000000\",\"990000\",[\"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\"],\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"1700000000\"]. Compute it locally without hitting any node."}],"resultDescription":"Returns a JSON object containing the original function signature, the 4-byte selector (hex), the full ABI-encoded calldata (selector + encoded arguments), the calldata length in bytes, the parsed argument types array, a plain-language note explaining the result, and a source field describing how the data was computed locally.","failureModes":["Invalid or malformed function signature returns an error (e.g. missing parentheses or unsupported type)","Mismatched argument count vs signature types causes encoding failure","Malformed JSON array in args parameter causes parse error","Unsupported ABI types (e.g. custom structs without tuple notation) may fail to encode","Arguments with wrong types (e.g. string where uint256 expected) return encoding errors"],"whenToPreferThis":"Choose this endpoint when you need to ABI-encode a contract call offline — without connecting to an Ethereum node or RPC provider — and want both the 4-byte selector and full calldata in one call. Ideal for constructing raw transactions, building multicall payloads, or verifying selectors without any web3 library dependency. Prefer over on-chain methods when speed and statelessness matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T13:05:40.204Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-abi-encode-call-e75d6e23"}