Submitted by kutugu, also found by sces60107 and Banditx0x (1, 2)
https://github.com/code-423n4/2023-10-canto/blob/40edbe0c9558b478c84336aaad9b9626e5d99f34/canto_ambient/contracts/mixins/LiquidityMining.sol#L181
https://github.com/code-423n4/2023-10-canto/blob/40edbe0c9558b478c84336aaad9b9626e5d99f34/canto_ambient/contracts/mixins/LiquidityMining.sol#L188
https://github.com/code-423n4/2023-10-canto/blob/40edbe0c9558b478c84336aaad9b9626e5d99f34/canto_ambient/contracts/mixins/LiquidityMining.sol#L48
When calculating reward distribution, the contract uses the current positions liquidity time weight divided by the total liquidity time weight of the pool, instead of the total liquidity time weight of the pool that meets the reward conditions.
This means that if there is a large amount of liquidity in the pool that is not eligible for rewards, the total weekly reward distribution will be much less than the rewardPerWeek, which should not be expected.
In the pool, there is only one position that meets the reward conditions, and there is also one position that does not meet the conditions.
According to common sense, weekly rewards should be distributed to the only position that meets the reward conditions based on rewardPerWeek. However, in reality, you can see that the rewards that should be distributed every week have been reduced to 1/4 due to the ineligible position.
Hardhat
Since the reward distribution of concentrated type rewards is conditionally restricted, the conditional restrictions should also be taken into account when calculating the total weight, rather than directly counting the total amount of liquidity.
Context
OpenCoreCH (Canto) disputed and commented via duplicate Issue #94:
LSDan (judge) commented:
For this audit, 37 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by adriro received the top score from the judge.
The following wardens also submitted reports: radev_sw, albahaca, MatricksDeCoder, JP_Courses, 0xDING99YA, 0xdice91, Mike_Bello90, 0xTheC0der, Eurovickk, marqymarq10, orion, sces60107, wahedtalash77, xAriextz, BoRonGod, gzeon, SovaSlava, matrix_0wl, 3docSec, taner2344, Topmark, 0x3b, cookedcookee, HChang26, 100su, zpan, GKBG, BRONZEDISC, lukejohn, IceBear, hunter_w3b, 0xAadi, pep7siup, kutugu, tpiliposian, and 0xWaitress.
