Skip to main content Module arbitrary_send_eth Copy item path Source use super::ArbitrarySendEth ; ๐ use crate::linter::LateLintPass ; ๐ use crate::linter::LintContext ; ๐ use crate::sol::Severity ; ๐ use crate::sol::SolLint ; ๐ use crate::sol::analysis::DEFAULT_HELPER_ANALYSIS_CACHE_LIMIT ; ๐ use crate::sol::analysis::HelperAnalysisCache ; ๐ use crate::sol::analysis::arg_for_param ; ๐ use crate::sol::analysis::branch_always_exits ; ๐ use crate::sol::analysis::callee_no_arg_returns ; ๐ use crate::sol::analysis::function_no_arg_returns ; ๐ use crate::sol::analysis::is_address_like_cast ; ๐ use crate::sol::analysis::is_address_self ; ๐ use crate::sol::analysis::is_builtin ; ๐ use crate::sol::analysis::is_contract_cast ; ๐ use crate::sol::analysis::is_literal_zero ; ๐ use crate::sol::analysis::is_msg_sender ; ๐ use crate::sol::analysis::is_require_or_assert ; ๐ use crate::sol::analysis::is_sender_member ; ๐ use crate::sol::analysis::loop_stmts ; ๐ use crate::sol::analysis::loop_update ; ๐ use crate::sol::analysis::modifier_prefix ; ๐ use crate::sol::analysis::referenced_item ; ๐ use crate::sol::analysis::tuple_elems ; ๐ use crate::sol::analysis::underlying_var ; ๐ use crate::sol::analysis::var_is_address_like ; ๐ use solar::ast::BinOpKind; ๐ use solar::ast::LitKind; ๐ use solar::ast::StateMutability; ๐ use solar::ast::UnOpKind; ๐ use solar::interface::Span; ๐ use solar::interface::data_structures::Never; ๐ use solar::interface::sym; ๐ use solar::sema::Gcx; ๐ use solar::sema::builtins::Builtin; ๐ use solar::sema::hir; ๐ use solar::sema::hir::CallArgs; ๐ use solar::sema::hir::ContractId; ๐ use solar::sema::hir::ContractKind; ๐ use solar::sema::hir::ElementaryType; ๐ use solar::sema::hir::Expr; ๐ use solar::sema::hir::ExprKind; ๐ use solar::sema::hir::FunctionId; ๐ use solar::sema::hir::Hir; ๐ use solar::sema::hir::ItemId; ๐ use solar::sema::hir::LoopSource; ๐ use solar::sema::hir::Modifier; ๐ use solar::sema::hir::Res; ๐ use solar::sema::hir::Stmt; ๐ use solar::sema::hir::StmtKind; ๐ use solar::sema::hir::TypeKind; ๐ use solar::sema::hir::Variable; ๐ use solar::sema::hir::VariableId; ๐ use solar::sema::hir::Visit; ๐ use solar::sema::ty::TyKind; ๐ use std::collections::HashSet ; ๐ use std::ops::ControlFlow ; ๐ Analyzer ๐ CallerGuards ๐ Recognises guards that restrict msg.sender to a deploy-time-fixed principal, backed by a
memoised analysis of which state variables may alias address(this). SelfAssignScan ๐ Scans one function, its modifiers / base constructors and inlined internal helpers for an
assignment that may plant address(this) into target. State ๐ Path-sensitive facts. HELPER_CALL_DEPTH ๐ Cap on inlined helper calls (covers ctor โ _init โ _initInner โ _initLeaf). HELPER_DEPTH ๐ Recursion budget for _msgSender()-style helper chains. SELF_ALIAS_DEPTH ๐ Recursion budget for self-alias chains. ARBITRARY_SEND_ETH expr_is_array_or_bytes ๐ expr_is_function ๐ identity_helper_arg ๐ Argument returned verbatim (modulo casts) by an identity helper call id(x) / Lib.id(x). index_is_static ๐ True when an index expression only depends on literals and state: no locals, parameters,
builtins (msg.sender) or non-cast calls. invoked_function ๐ The function invoked by a modifier or base-constructor invocation. is_msg_sender_like ๐ msg.sender modulo parens, casts, payable(..) and no-arg helpers such as _msgSender().is_numeric_cast ๐ uint<N>(..) / int<N>(..) cast head.is_trusted_literal ๐ An address literal or the integer literal 0. lhs_root_var ๐ Variable at the root of an lvalue, through member / index accesses and address casts. match_eth_library_call ๐ Destination of an OpenZeppelin Address / Solady SafeTransferLib ETH helper, called either
statically (Lib.f(to, ...)) or via using ... for address (to.f(...)). match_sink ๐ Destination of an ETH-sending call: selfdestruct(x), x.{call,send,transfer},
f{value: v}(), IFoo(x).f{value: v}() and common OpenZeppelin/Solady helpers. Sends to
address(this) or of a literal-zero amount are not sinks. peel_casts ๐ Looks through parens, payable(..), address-like casts and integer casts. stmt_contains_return ๐ True when any statement of a helper body is a return (bare or valued).