// send fee from user to YETI stakers
contractsCache.yusdToken.transferFrom(
_redeemer,
address(contractsCache.sYETI),
totals.YUSDfee
);
Since totals.YUSDfee can be 0. Checking if (totals.YUSDfee > 0) before the transfer can potentially save an external call and the unnecessary gas cost of a 0 token transfer.
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/TroveManagerRedemptions.sol#L228-L233
Since
totals.YUSDfee
can be0
. Checkingif (totals.YUSDfee > 0)
before the transfer can potentially save an external call and the unnecessary gas cost of a 0 token transfer.