The function Basket.handleFees() contains this line:
uint256 timeDiff = (block.timestamp - lastFee);
bondBlock is either zero (at initialization) or equal to some block.timestamp, so it can never be greater than the current block.timestamp. Therefore, there is no risk of underflow caused by this subtraction.
Impact
Subtractions perform underflow checks that are not necessary in this case.
Tool Used
Manual code review.
Recommended Mitigation Steps
Surround this line with an unchecked { ... } block to avoid the default underflow check.
Handle
pants
Vulnerability details
The function
Basket.handleFees()
contains this line:bondBlock
is either zero (at initialization) or equal to someblock.timestamp
, so it can never be greater than the currentblock.timestamp
. Therefore, there is no risk of underflow caused by this subtraction.Impact
Subtractions perform underflow checks that are not necessary in this case.
Tool Used
Manual code review.
Recommended Mitigation Steps
Surround this line with an
unchecked { ... }
block to avoid the default underflow check.