There is no risk of overflow caused by increamenting the iteration index in for loops (the i++ in for for (uint256 i = 0; i < _unbondingLockIds.length; i++)).
Increments perform overflow checks that are not necessary in this case.
Recommendation
Surround the increment expressions with an unchecked { ... } block to avoid the default overflow checks. For example, change the for loop:
Handle
WatchPug
Vulnerability details
There is no risk of overflow caused by increamenting the iteration index in for loops (the
i++
in forfor (uint256 i = 0; i < _unbondingLockIds.length; i++)
).Increments perform overflow checks that are not necessary in this case.
Recommendation
Surround the increment expressions with an
unchecked { ... }
block to avoid the default overflow checks. For example, change the for loop:https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L472-L479
to: