referrerpolicy=no-referrer-when-downgrade

Function solidity_selector

Source
pub const fn solidity_selector(fn_sig: &str) -> [u8; 4]
Expand description

Returns the Solidity selector for fn_sig.

Note that this is a const function, it is evaluated at compile time.

§Usage

let sel = solidity_selector("ownCodeHash()");
assert_eq!(sel, [219, 107, 220, 138]);