Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

SelectorTrait

Fully qualified path: alexandria_evm::selector::SelectorTrait

pub trait SelectorTrait

Trait functions

compute_selector

Computes the EVM function selector (first 4 bytes of the Keccak-256 hash of a function signature).

Arguments

  • self - A ByteArray containing the UTF-8 string of the function signature, e.g., "transfer(address,uint256)".

Returns

  • felt252 - The 4-byte (32-bit) selector represented as a felt252 value.

Fully qualified path: alexandria_evm::selector::SelectorTrait::compute_selector

fn compute_selector(self: ByteArray) -> felt252