Let’s say a user creates two separate positions, one is [tick-15, tick] and the second is [tick, tick+15]. The user is covering the entirety of the tick range to receive rewards but does not receive any.
Recommendation: The current system checks a range of ticks. The way this range is checked is based on if the user provided liquidity in the specific range. Instead, check if each tick has been provided liquidity. This also saves a user from having to do an extra claimConcentratedRewards() if they have multiple in range positions that have different start and end indexes.
Lines of code
https://github.com/marjon-call/2023-10-canto/blob/29c92a926453a49c8935025a4d3de449150fc2ff/canto_ambient/contracts/mixins/LiquidityMining.sol#L156-L196
Vulnerability details
Let’s say a user creates two separate positions, one is [tick-15, tick] and the second is [tick, tick+15]. The user is covering the entirety of the tick range to receive rewards but does not receive any.
We see that
posKey
is defined like this:This uses the lowerTick and upperTick of a position to create
posKey
. Then liquidity is calculated based on usingposKey
:Recommendation: The current system checks a range of ticks. The way this range is checked is based on if the user provided liquidity in the specific range. Instead, check if each tick has been provided liquidity. This also saves a user from having to do an extra claimConcentratedRewards() if they have multiple in range positions that have different start and end indexes.
Assessed type
Math