eth_selector
Derive the 4-byte function selector or 32-byte event topic from a Solidity signature.
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".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| kind | No | 'function' returns the 4-byte selector; 'event' returns the 32-byte topic0 (keccak of the canonical signature). | function |