Lucene search

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

Wrong reward calculation

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

Handle

0xsanson

Vulnerability details

Impact

In ConcentratedLiquidityPoolManager, an user can claimReward of a subscribed position.
In order to compute the correct amount, secondsUnclaimed needs to be calculated, but it’s implemented incorrectly:

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

This line should be: uint256 secondsUnclaimed = ((maxTime - incentive.startTime) << 128) - incentive.secondsClaimed;.

#Proof of Concept
<https://github.com/sushiswap/trident/blob/c405f3402a1ed336244053f8186742d2da5975e9/contracts/pool/concentrated/ConcentratedLiquidityPoolManager.sol#L110&gt;

Tools Used

editor

Recommended Mitigation Steps

Correct the computations.


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

All reactions