Unnecessary checked arithmetic in Basket.handleFees()
#27
Labels
bug
Warden finding
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
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.The text was updated successfully, but these errors were encountered: