"Medium severity issue. 200,000 CLO (~0,442 BTC) for finding security vulnerabilities and bugs, that could not be directly exploited but can affect contracts in some specific circumstances and can cause a loss of funds for a certain stakers."
- Staker X stake at time T.
- Staker X claim is made more than 27 days after the first start_staking call.
if the claim is made in the worst case scenario 27+26 days after the first stake request:
_StakerWeight
will represent only the first 27 days staker weight.TotalStakingWeight
will represent the 27+26 days total weight. Assuming a growth of 0% since the 27th day of total staked amount the real reward will be divided by half, any higher growth will reduce the reward more.
This issue is related with all stakers that wait more than the claim period. Other scenarios can cause the same issue. the one presented is just one case.
Calculate the whole staking weight of a staker including the whole staking period.
0x582121f1f16d1df3483a0c49650f4416aaf6e52d