Abi Encode
abi_encodeBuild EVM calldata offline: function selector + ABI-encoded arguments from a human signature such as transfer(address,uint256) or exactInputSingle((address,address,uint24,address,uint256,uint256,uint160)). Tuples/structs, fixed and dynamic arrays, bytes, strings and signed ints supported. mode=params gives abi.encode without a selector, mode=packed gives abi.encodePacked plus its keccak256 (as used for hashes and signatures). Returns hex, 32-byte words and length. Price: $0.003 USDC per successful call (x402, Solana). Same tool over HTTPS: GET https://scorptech.it.com/api/x402/v1/abi-encode
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"signature": "<signature>"
},
"name": "abi_encode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments as a JSON array (nested arrays for arrays/tuples; big integers as strings; bytes as 0x-hex) | |
| mode | No | call = selector + abi.encode, params = abi.encode only, packed = abi.encodePacked | call |
| signature | Yes | Function signature, e.g. transfer(address,uint256); param names allowed; for mode=params/packed just the type list, e.g. (address,uint256) |