In the above POC, it is shown that when the pool is initialized with reward tokens, the first depositor gains all the reward tokens due to failure to accurately recalculate the Reward Per Shares on the addition of new positions.
Tool used
Manual Review
Recommendation
Recalculate the rewards for each user taking into account newly opened positions before harvesting or withdrawal.
Praise03
Medium
Incorrect Implementation Of Rewards Calculation
Impact
Every opened position after the first created position gets no rewards, as all shares is allocated to the first user.
Code Snippet
In the above POC, it is shown that when the pool is initialized with reward tokens, the first depositor gains all the reward tokens due to failure to accurately recalculate the Reward Per Shares on the addition of new positions.
Tool used
Manual Review
Recommendation
Recalculate the rewards for each user taking into account newly opened positions before harvesting or withdrawal.
Duplicate of #116