The claiming points amounts is related to the duration and the last total staked amount, if an user increase the totalStaked during the last epoch, this value of totalStaked will be considered for all the periods of staking. An attacker could stake a large amount during the last epoch to get a maximum of points.
We made two tests.
In the first test, the user alice stake 0.0001 ether for 5 weeks then 2 ether for 2 weeks, alice claim points and obtains 799999999999999999998 points.
In the second test, the user alice stake 2 ether for 2 weeks than 0.0001 ether for 5 weeks, alice claim points and obtains 799999999999999999998 points.
This situation is unfair because the ponderated staking amount by time is not the same.
Loss of funds for some users.
Foundry
Modify the modifier updatePendingPoints(address user) to include the history of staking for each period.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.