Build contract call data (unsigned, nothing sent)
contract_encode_callBuild the calldata for any function of an EVM contract (write functions included) and return it with the target, chain, value (payable functions only, in wei) and a decoded human-readable view, for the user's own wallet to review, sign and send. SwapChan never signs, sends or broadcasts it. Powered by blocktools (ABI coding). How to combine this with the other tools: swapchan_playbook (workflows: find-money, best-swap, rebalance, revoke-approvals, bridge-stuck, token-safety, recover-old-wallet).
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": {
"chainId": "<chainId>",
"address": "<address>",
"function": "<function>"
},
"name": "contract_encode_call"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | No | Optional ABI JSON to use instead of the Sourcify / Etherscan lookup (labelled as pasted; not checked against source). | |
| args | No | Arguments in order; arrays/tuples as JSON lists, big numbers as decimal strings. | |
| value | No | Wei to send (payable functions only) | |
| address | Yes | Contract address (0x...) | |
| chainId | Yes | EVM chain id or name (1 eth, 8453 base, 42161 arbitrum, 10 optimism, 137 polygon, 56 bnb, 43114 avalanche, 59144 linea, 534352 scroll). | |
| function | Yes | Function name, or the full signature for overloads, e.g. "balanceOf" or "get(uint256)" |