Skip to main content

is_hook_comparison

Function is_hook_comparison 

Source
fn is_hook_comparison<'hir>(
    gcx: Gcx<'hir>,
    hir: &'hir Hir<'hir>,
    expr: &'hir Expr<'hir>,
    recipient: VariableId,
    token: VariableId,
    want: BinOpKind,
) -> bool
Expand description

recipient.onERC721Received(...) <op> x, and nothing else. The comparison must be the whole expression: in to == trusted || hook(to) == selector the hook never runs for trusted. The other operand must be able to hold the accepting answer, and must not be a hook call itself, which would compare the recipient against itself.