Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

has_dynamic

Checks if any of the provided EVM types are dynamic.

Dynamic types in Solidity/EVM include arrays, strings, and bytes. These types are not encoded inline and instead use an offset pointing to their actual data location elsewhere in calldata. This helper is used to determine if special encoding/decoding logic is needed.

Arguments

  • types - A span of EVMTypes representing the types to check.

Returns

  • true if any type is dynamic; otherwise, false.

Examples

let static_types = array![EVMTypes::Uint256, EVMTypes::Address].span();
assert!(!has_dynamic(static_types));

let dynamic_types = array![EVMTypes::Uint256, EVMTypes::Bytes].span();
assert!(has_dynamic(dynamic_types));

Fully qualified path: alexandria_evm::utils::has_dynamic

pub fn has_dynamic(types: Span<EVMTypes>) -> bool