Lucene search

K
code423n4Code4renaCODE423N4:2021-09-SUSHITRIDENT-2-FINDINGS-ISSUES-87
HistoryOct 06, 2021 - 12:00 a.m.

Integer underflow error in claimReward of ConcentratedLiquidityPoolManager

2021-10-0600:00:00
Code4rena
github.com
3

Handle

broccoli

Vulnerability details

Impact

The claimReward function of ConcentratedLiquidityPoolManager calculates the secondsUnclaimed variable using a formula with an unclear intention:

uint256 secondsUnclaimed = (maxTime - incentive.startTime) << (128 - incentive.secondsClaimed);

This formula causes an integer underflow error when incentive.secondsClaimed is greater than 128, which generally happens in most cases since incentive.secondsClaimed is scaled by a factor of 1 << 128. The integer underflow reverts the transaction and prevents anyone from claiming the reward.

Proof of Concept

Referenced code:
ConcentratedLiquidityPoolManager.sol#L93
ConcentratedLiquidityPoolManager.sol#L110

Recommended Mitigation Steps

Fix the calculation of secondsUnclaimed.


The text was updated successfully, but these errors were encountered:

All reactions