{"uid":"cap_zAbQgEQ5-7VqqCCGvokJh","slug":"abi-encode-evm-contract-function-calldata-encoder-e67cab33","name":"ABI Encode – EVM Contract Function Calldata Encoder","description":"Encode a contract function call (calldata) from its signature and arguments, e.g. transfer(address,uint256) with [to, amount]: selector and hex data ready to sign or simulate.","url":"https://api.vextorium.com/v1/abi-encode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"function":{"type":"string"},"arguments":{"type":"array"}}},"responseSchema":{"type":"json","example":{"bytes":68,"calldata":"0xa9059cbb0000000000000000000000007e5f4552091a69125d5dfcb7b8c2659029395bdf00000000000000000000000000000000000000000000000000000000000f4240","function":"transfer(address,uint256)","selector":"0xa9059cbb"}},"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_d_E_0QgPU6MjuYc7Kg6JN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes a Solidity function signature and arguments into ABI-encoded calldata (selector + hex data) ready to sign, broadcast, or simulate on EVM chains.","exampleAgentPrompt":"Encode the calldata for calling transfer(address,uint256) on an ERC-20 contract, with recipient 0x7e5F4552091A69125d5DfCb7b8C2659029395Bdf and amount 1000000.","exampleUseCases":[{"title":"Build raw ERC-20 transfer calldata","prompt":"Encode the calldata for an ERC-20 transfer call — function is transfer(address,uint256), recipient is 0xAbCd1234AbCd1234AbCd1234AbCd1234AbCd1234, and the amount is 500000000000000000."},{"title":"Simulate a DeFi deposit transaction","prompt":"I need the ABI-encoded calldata to call deposit(uint256,address) with amount 1000000000 and receiver 0x7e5F4552091A69125d5DfCb7b8C2659029395Bdf so I can simulate the transaction before sending."},{"title":"Get function selector for a contract method","prompt":"What's the 4-byte function selector and full calldata for calling approve(address,uint256) with spender 0xDEADbeef00000000000000000000000000000001 and value 115792089237316195423570985008687907853269984665640564039457584007913129639935?"}],"resultDescription":"Returns a JSON object with the hex-encoded calldata string (including 4-byte selector prefix), the isolated 4-byte function selector, the canonical function signature string, and the total byte length of the calldata. For example: {\"calldata\":\"0xa9059cbb0000...\",\"selector\":\"0xa9059cbb\",\"function\":\"transfer(address,uint256)\",\"bytes\":68}.","failureModes":["Invalid or malformed function signature returns an error (e.g. missing parentheses or unknown types)","Argument count mismatch with the function signature causes encoding failure","Unsupported Solidity types (e.g. tuple/struct variants) may not encode correctly","Malformed address arguments (wrong length or non-hex) cause encoding errors","Empty or missing function field returns a validation error"],"whenToPreferThis":"Choose this endpoint when you need to programmatically construct raw EVM calldata from a Solidity function signature and typed arguments — especially for transaction simulation, raw signing, or building payloads for multicall contracts. Prefer it over client-side ethers.js/viem encoding when running in a server-less or agent context without a JS runtime, or when you need a lightweight HTTP call to produce deterministic calldata without installing a full Web3 library.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T12:36:54.123Z","isFirstParty":false,"canonicalSlug":"abi-encode-evm-contract-function-calldata-encoder-e67cab33"}