A test scenario needs to simulate actions by multiple stakers by calling the following methods in different orders and different inputs:
stake - a staker stakes some tokens and maybe also donate some of the intereset
withdrawStakeAndInterest - staker withdraw his whole/part of his stake and always all of the interest earned
withdrawGDInterest - staker withdraw only his earned interest
The following free variables are simulated in the scenario
interest token exchange rate to calculate either how many interestToken are bought for each stake or to calculate how much globalTotalStake has earned
gd exchange rate - can be either exchange rate vs interestToken or stakedToken, this is required in order to simulate the following variable
gd interest earned - how much interest was earned. required to be calculated before every staker action
because calling updateGlobalGDYieldPerToken is a must
notice that updateGlobalGDYieldPerToken must be called before every "simulated" block
in these scenarios we will assume that each staker action happens on a separate block
[x] build 2 scenarios in pseudo code including in comments any calculations done that explain the values of simulated variables
A test scenario needs to simulate actions by multiple stakers by calling the following methods in different orders and different inputs:
The following free variables are simulated in the scenario
notice that updateGlobalGDYieldPerToken must be called before every "simulated" block in these scenarios we will assume that each staker action happens on a separate block