eth_selector
Compute the 4-byte function selector or 32-byte event topic by normalizing a Solidity signature to its canonical ABI form.
Instructions
Derive the 4-byte function selector or 32-byte event topic from a signature.
Returns {kind, signature (canonicalized), selector} for functions, or {kind, signature, topic0} for events.
Example: eth_selector("transfer(address,uint256)") -> selector="0xa9059cbb".
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": "eth_selector"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | 'function' returns the 4-byte selector; 'event' returns the 32-byte topic0 (keccak of the canonical signature). | function |
| signature | Yes | A Solidity function/event signature, e.g. 'transfer(address,uint256)'; parameter names, data locations, and type aliases (uint->uint256) are normalized to canonical ABI form. |