Skip to main content

Module arbitrary_send_erc20

Module arbitrary_send_erc20 

Source

StructsΒ§

Analyzer πŸ”’
AssignRhs πŸ”’
RHS facts captured before any write so tuple-swap assignments stay consistent.
FlowState πŸ”’
InternalCallsiteCollector πŸ”’
NestedCallCollector πŸ”’
Walks an expression tree and records every internal callee resolvable to a FunctionId. Used to widen collect_state_writes by one call level.
ParamCallsiteFacts πŸ”’
PendingRepayment πŸ”’
Outstanding EIP-3156 repayment licensed by a prior onFlashLoan call.
PermitRecord πŸ”’
(token, owner) of an EIP-2612 permit recorded earlier on the current path with spender == address(this).
ProjectIndex πŸ”’
StateWriteCollector πŸ”’
Collects state-variable assignments / deletes reached from the given stmts. Single-level: does not follow nested function calls.

EnumsΒ§

TokenKey πŸ”’
Identifier used to correlate permit / sink token receivers. Field lets cfg.token.permit(...) and cfg.token.transferFrom(...) match (FN-5).

ConstantsΒ§

HELPER_DEPTH πŸ”’
Recursion budget for _msgSender()-style helper chains.
PROJECT_INDEX πŸ”’

StaticsΒ§

ARBITRARY_SEND_ERC20
ARBITRARY_SEND_ERC20_PERMIT

FunctionsΒ§

body_has_break_or_continue πŸ”’
break/continue targeting the current loop (nested loops shadow them).
branch_always_exits πŸ”’
return, custom-error revert, revert(...), or assert(false) / require(false, ...).
build_project_index πŸ”’
canonical_args πŸ”’
Resolves positional or named call args to a fixed positional ordering. aliases[i] holds the parameter names accepted for slot i in the named form. Returns None if arity differs or any slot is unmatched.
collect_modifier_safety πŸ”’
Hoists require(modParam == msg.sender | address(this)) guards from the modifier prefix (statements before _;) to the caller’s argument. out_self receives params proven equal to address(this).
collect_state_writes πŸ”’
contains_unanalysable πŸ”’
true if any statement is StmtKind::Err (currently catches inline assembly, which solar doesn’t yet lower to HIR).
contract_has_function πŸ”’
count_placeholders πŸ”’
direct_contract_id πŸ”’
do_while_user_stmts πŸ”’
Strips the synthesized trailing if (!cond) break; from the HIR do-while lowering.
expr_contract_id πŸ”’
expr_is_address πŸ”’
True when expr’s static type is address / address payable.
expr_ty πŸ”’
has_solady_safe_transfer_lib πŸ”’
Whether the sources declare a Solady-shaped SafeTransferLib library.
internal_call_args πŸ”’
is_address πŸ”’
is_address_cast πŸ”’
is_address_self πŸ”’
address(this) or bare this, including through payable(...) and parens wraps.
is_amount_plus_fee πŸ”’
True when expr is amount + fee or fee + amount, parens-tolerant.
is_break_stmt πŸ”’
is_builtin πŸ”’
is_cast_callee πŸ”’
true when callee is a type-cast head, i.e. address(...), an elementary-type cast, or an interface/contract cast like IERC20(...).
is_elementary πŸ”’
is_exit_call πŸ”’
is_internal_callsite_seed_candidate πŸ”’
is_loop_termination_if πŸ”’
is_require_or_assert πŸ”’
library_has_safe_transfer_from πŸ”’
4-arg safeTransferFrom(token, address, address, uint256). token is either address (Solady) or a contract declaring ERC20’s transferFrom(...)β†’bool (OZ SafeERC20); ERC721/1155 helpers are excluded since their transferFrom has no return.
match_flash_loan_call πŸ”’
EIP-3156 onFlashLoan(address,address,uint256,uint256,bytes) returns (bytes32). Only returns a record when the receiver type declares the exact sig and every tracked arg resolves to a VariableId; literal args yield None.
match_sink πŸ”’
Matches an ERC20-like transfer sink. Returns (from_arg, token_var) where token_var is the receiver’s underlying variable id when available (used for permit correlation).
modifier_prefix_always_exits πŸ”’
true when the modifier body has a single _; and any preceding statement definitely exits (making the calling function’s body unreachable).
project_index_for πŸ”’
receiver_contract_id πŸ”’
Resolves the static contract type of recv: a contract-typed expression, a direct contract reference (e.g. a library), or an interface/contract cast.
resolve_internal_fn πŸ”’
Resolves a call’s callee to a FunctionId for plain name() / this.name() patterns inside the same contract. Returns None for external / library / member-of-state-var / unresolved calls.
seed_immutable_facts πŸ”’
Harvests self_vars / safe_vars facts about immutable / constant state vars of cid: both declaration initializers and direct constructor assignments.
seed_internal_callsite_facts πŸ”’
token_key πŸ”’
Constructs a TokenKey for the receiver of a permit/sink call. Supports <var> (with cast / payable peeling via underlying_var) and <var>.<field> (a struct-field path).
ty_contract_id πŸ”’
ty_is_address πŸ”’
underlying_var πŸ”’
Resolves a VariableId for bare idents and type-cast / payable(...) / parens wraps.