Skip to main content

is_unchecked_token_op

Function is_unchecked_token_op 

Source
fn is_unchecked_token_op(gcx: Gcx<'_>, function_id: FunctionId) -> bool
Expand description

Whether function_id is one of the token operations of solmate’s SafeTransferLib. safeTransferETH stays out: sending ETH involves no token code. A same-name function of another library (Uniswap’s TransferHelper style) stays out through the resolution, and so does a same-name library from another package (Solady’s SafeTransferLib checks token code on the empty-return path), which fails the provenance check: the declaring source must come from a solmate package path (lib/solmate, solmate/...). Matching a whole path component rather than a substring keeps a vendored or patched copy under a misleading path such as vendor/solmate-fixed/ from being recognized.