Unnecessary checked arithmetic in Auction.settleAuction()
, Auction.bondBurn()
, Basket.changePublisher()
, Basket.changeLicenseFee()
and Basket.publishNewIndex()
#25
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 functions
Auction.settleAuction()
andAuction.bondBurn()
contain this line:Similarly, the function
Basket.changePublisher()
contains the linethe function
Basket.changeLicenseFee()
contains the lineand the function
Basket.publishNewIndex()
contains the lineEach of
bondBlock
,pendingPublisher.block
,pendingLicenseFee.block
andpendingWeights.block
is either zero (at initialization) or equal to someblock.number
, so they won't go any near totype(uint256).max
at the upcoming decades. Therefore, there is no risk of overflow caused by these additions.Impact
Additions perform overflow checks that are not necessary in this case.
Tool Used
Manual code review.
Recommended Mitigation Steps
Surround these lines with
unchecked { ... }
blocks to avoid the default overflow checks.The text was updated successfully, but these errors were encountered: