AbiDecodeTrait
Fully qualified path: alexandria_evm::decoder::AbiDecodeTrait
pub trait AbiDecodeTrait
Trait functions
decode
Decodes EVM calldata for the specified types into a Span of felt252 values.
This function is the primary entry point for decoding EVM calldata in Starknet Cairo.
It accepts a list of EVM-compatible types and decodes values from calldata accordingly.
The resulting span of felt252 values can be directly used in Starknet’s call_syscall.
This function is typically implemented as a dispatcher that calls appropriate decoding
routines (e.g., decode_uint, decode_tuple, decode_array, etc.) based on the types
passed in.
Arguments
self- Reference toEVMCalldatacontext which maintains the calldata byte array, current offset, and relative offset for dynamic type resolution.types- A list (Span) ofEVMTypesto decode from the current calldata position.
Returns
Span<felt252>- A Cairo Span containing the decoded values as felt252
Fully qualified path: alexandria_evm::decoder::AbiDecodeTrait::decode
fn decode(ref self: EVMCalldata, types: Span<EVMTypes>) -> Span<felt252>