Skip to main content

parse_selector_bytes

Function parse_selector_bytes 

Source
fn parse_selector_bytes(s: &str) -> Result<[u8; 4], String>
Expand description

Parse a selector string: a 4-byte hex (0xd09de08a), a full signature (transfer(address,uint256)), or a well-known TIP-20 function name shorthand.

Recognized shorthands: transfer, approve, transferFrom, transferWithMemo, transferFromWithMemo. These resolve to the standard ERC20/TIP-20 signatures. Unknown names without parentheses are hashed as name().