cast-sig - Get the selector for a function.
cast sig [options] sig
Get the selector for a function.
The signature (sig) is a fragment in the form <function name>(<types...>).
{{#include common-options.md}}
-
Get the selector for the function
transfer(address,uint256):cast sig "transfer(address,uint256)" -
Get the selector for a function that expects a
struct:contract Test { struct MyStruct { address addr; uint256 amount; } function myfunction(MyStruct memory t) public pure {} }
Structs are encoded as tuples (see struct encoding).
cast sig "myfunction((address,uint256))"