Skip to main content

Module assert_state_change

Module assert_state_change 

Source

ConstantsΒ§

CURRENT_CONTRACT πŸ”’

StaticsΒ§

ASSERT_STATE_CHANGE

FunctionsΒ§

contract_id_of πŸ”’
Extracts the contract ID from an expression whose static type is a contract or interface.
current_contract πŸ”’
expr_ty πŸ”’
find_state_change πŸ”’
Recursively searches expr for the first sub-expression that modifies state. Returns its span so the diagnostic points at exactly where the mutation occurs.
is_address_builtin_member πŸ”’
is_address_like πŸ”’
is_assert πŸ”’
is_dynamic_array_or_bytes πŸ”’
Returns true when expr is a dynamic array or bytes
is_this_or_super πŸ”’
library_extensions_by_name πŸ”’
Memoized per-HIR map of library function names to candidate FunctionIds. Building the map requires a full hir.function_ids() scan; without memoization that scan would run on every eligible call site in the program and scale poorly.
lvalue_is_state_var πŸ”’
Returns true if the lvalue expression ultimately targets a storage variable. Peels through index, slice, member, and payable wrappers to find the root identifier. Locals declared storage are aliases into contract storage and count as state mutations.
resolve_library_extension πŸ”’
Finds library functions in the HIR that could be a using for extension matching the given method name, call arity, and receiver type. A library extension function has arg_count + 1 parameters (the extra one being the receiver passed implicitly) with the first parameter in storage, and that first parameter’s type must structurally match the receiver’s static type, otherwise an unrelated library with a same-named function would false-positive on a contract/interface call.
resolve_member_overloads πŸ”’
Returns all overloads of the called member function that match the call’s argument count. Matching by arity narrows overload candidates; the caller flags the call if any candidate mutates state, since Solar does not resolve which specific overload was selected.
set_current_contract πŸ”’
ty_is_address πŸ”’
type_contract_id πŸ”’