Submitted by 0xNineDec
https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/AmmGauge.sol#L56
https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/AmmGauge.sol#L140
The first staker within the AmmGauge may not get the rewards if the pool is not checkpointed right after he stakes and before he wants to claim the rewards.
A testing environment that reproduces how the protocol is going to be deployed and managed is used to evaluate this case under the following assumptions and simplifications.
In order to illustrate this scenario we will show both the vulnerable and non vulnerable situations.
Vulnerable Situation:
Non Vulnerable Situation:
The code to show this has a secureCheckpoints toggle that can be set as true or false to trigger (or not) the intermediate poolCheckpoints.
The outputs for both cases are shown on the following chart. The initial staking amount is 10eth amount of the DummyERC20 token.
chase-manning (Backd) confirmed, but disagreed with severity and commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
Alex the Entreprenerd (judge) commented:
