Skip to main content Module arbitrary_send_erc20 Copy item path Source use super::ArbitrarySendErc20 ; π use crate::linter::LateLintPass ; π use crate::linter::LintContext ; π use crate::sol::Severity ; π use crate::sol::SolLint ; π use crate::sol::analysis::arg_for_param ; π use crate::sol::analysis::branch_always_exits ; π use crate::sol::analysis::expr_is_address ; π use crate::sol::analysis::is_address_like_cast ; π use crate::sol::analysis::is_address_self ; π use crate::sol::analysis::is_address_type ; π use crate::sol::analysis::is_elementary ; π use crate::sol::analysis::is_msg_sender ; π use crate::sol::analysis::is_require_or_assert ; π use crate::sol::analysis::loop_update ; π use crate::sol::analysis::modifier_prefix ; π use crate::sol::analysis::receiver_contract_id ; π use crate::sol::analysis::state_lhs_vars ; π use crate::sol::analysis::tuple_elems ; π use crate::sol::analysis::underlying_var ; π use solar::ast::BinOpKind; π use solar::ast::StateMutability; π use solar::ast::UnOpKind; π use solar::ast::Visibility; π use solar::interface::Span; π use solar::interface::Symbol; π use solar::interface::data_structures::Never; π use solar::sema::Gcx; π use solar::sema::hir; π use solar::sema::hir::CallArgs; π use solar::sema::hir::ContractId; π use solar::sema::hir::ContractKind; π use solar::sema::hir::Expr; π use solar::sema::hir::ExprKind; π use solar::sema::hir::FunctionId; π use solar::sema::hir::FunctionKind; π use solar::sema::hir::Hir; π use solar::sema::hir::ItemId; π use solar::sema::hir::LoopSource; π use solar::sema::hir::Modifier; π use solar::sema::hir::Stmt; π use solar::sema::hir::StmtKind; π use solar::sema::hir::TypeKind; π use solar::sema::hir::VariableId; π use solar::sema::hir::Visit; π use std::cell::RefCell ; π use std::collections::HashMap ; π use std::collections::HashSet ; π use std::hash::Hash ; π use std::hash::Hash ; π use std::ops::ControlFlow ; π use std::rc::Rc ; π Analyzer π CallsiteCollector π PendingRepayment π Outstanding EIP-3156 repayment licensed by a prior onFlashLoan call. PermitRecord π An EIP-2612 permit with spender == address(this) seen earlier on the current path. Rhs π Facts about an assignmentβs RHS, captured before any write. Sink π An ERC20 transferFrom-shaped sink. State π Path-sensitive facts. StateWrites π TokenKey π Identifier correlating permit and sink token receivers: token or cfg.token. CALLSITE_INDEX π HELPER_DEPTH π Recursion budget for _msgSender()-style helper chains. ARBITRARY_SEND_ERC20 ARBITRARY_SEND_ERC20_PERMIT callsite_index π The call-site index of hir, built once per compilation unit. canonical_args π Call arguments in declaration order, with the expected arity. common_entries π has_transfer_from π ERC20βs transferFrom(address,address,uint256) returns (bool). interface_has_function π is_internal_only π Internal functions and modifiers are only reachable from the compilation unit, so their
parameters can be proven safe from the invocation sites seen there. library_has_safe_transfer_from π 4-arg safeTransferFrom(token, address, address, uint256) where token is address (Solady)
or an ERC20 contract type (OpenZeppelin SafeERC20); ERC721/1155 helpers are excluded since
their transferFrom has no return value. match_flash_loan_call π EIP-3156 receiver.onFlashLoan(initiator, token, amount, fee, data) on a receiver type
declaring the exact signature. Literal arguments yield None. match_sink π recv.transferFrom(from, to, amt) / recv.safeTransferFrom(from, to, amt) on a contract
declaring ERC20βs transferFrom(address,address,uint256) returns (bool) (ERC721βs same-named
overload is excluded), addr.safeTransferFrom(..) via using SafeTransferLib for address,
or the library form Lib.safeTransferFrom(token, from, to, amt).origin_matches π True when expr is base(..) or a variable in vars, through parens, payable(..), casts,
ternaries whose both arms qualify and no-arg helpers whose body returns such an expression. state_writes π State variables written by fid or by the internal functions it calls (one level deep). sum_operands π a + b with both operands variables.token_key π token or cfg.token receiver key, through casts and payable(..).CallsiteFacts π Per internal function, whether every call site passes a statically safe / self argument for
each parameter; None when some call site could not be matched to the parameters.