Skip to main content

Module exprs

Module exprs 

Source
Expand description

Expression-shape probes over Solar HIR (and a few AST-level ones).

Constants§

OPENZEPPELIN_ROOTS
Package-root directory names of the OpenZeppelin distributions (npm scope and git submodules).

Functions§

address_call_receiver
Receiver of <expr>.{call,delegatecall,transfer,send} (value-bearing sinks), including the .call{value: x}(...) option form.
any_subexpr
True if pred holds for expr or any of its sub-expressions.
arg_for_param
The argument bound to param of function_id in args, positional or named.
ast_bool_literal
AST-level boolean literal, through parens.
callee_no_arg_returns
True when callee names a zero-parameter function whose body returns an expression matching pred.
cast_type
The elementary type an explicit cast head T(...) converts to.
dispatched_function
The function an internal call made from within contract_id dispatches to: a virtual call resolves to the most derived override, super.f to the next base implementation, and a qualified Base.f to that declaration exactly. None for external and unresolved callees.
for_each_child
Calls f on every direct sub-expression of expr, in evaluation order.
for_each_lhs_var
Calls f for each resolved variable at the root of an lvalue, peeling index/slice/member/payable/unary/delete wrappers and tuple destructuring.
function_no_arg_returns
True when fid takes no parameters and its body is return e; or namedRet = e; (optionally followed by a bare return;) with pred(e).
has_side_effect
True if evaluating expr performs an assignment, delete or increment/decrement.
is_address_cast
address(...) / address payable(...) cast head.
is_address_like_cast
address(...) or IFoo(...) cast head.
is_address_self
address(this), payable(this), IFoo(this), IFoo(address(this)), or bare this.
is_builtin
True if expr resolves to the given builtin name.
is_call_with_gas_limit
True if a HIR call carries an explicit gas: option.
is_contract_cast
IFoo(...) contract / interface cast head.
is_exit_call
revert(...), selfdestruct(...), require(false, ...) or assert(false).
is_literal_false
The boolean literal false.
is_literal_zero
The integer literal 0.
is_low_level_call
AST-level: target.call(...), .delegatecall(...), .staticcall(...), with or without {value: x} options.
is_msg_sender
msg.sender.
is_require_or_assert
True if callee resolves to the builtin require or assert.
is_revert_call
revert(...), revert Err(...)-style builtin revert call (any form).
is_sender_member
msg.sender or tx.origin.
is_zero_value
A literal zero/false or an elementary cast or arithmetic negation of one.
lhs_local_var
The local (non-state) variable a bare identifier refers to.
referenced_item
The item a bare identifier refers to, if any.
runtime_entry_points
The functions reachable through the runtime dispatch of a most-derived contract: its interface functions plus the inherited fallback/receive, if any.
source_in_package
True if the source file of source_id lives under one of the given package-root directory names (matched as whole, case-insensitive path components).
state_lhs_vars
State variables written by an lvalue: peels index/slice/member/payable/unary/delete wrappers and tuple destructuring. Duplicates are removed.
tuple_elems
The elements of a tuple expression (through parens).
underlying_var
The variable a bare identifier refers to, looking through parens, payable(...) and address-like casts (address(x), IFoo(x)).
var_is_address_like
address / address payable or a contract/interface type.
write_target
The lvalue written by an assignment, delete or increment/decrement expression.