Users will not be able to claim from current epoch in unstakeAll
Based on the comments below the unstakeAll function is meant to enable users unstake from all functions
However, based on the current implementation it is not possible for users to claim upto and including the current epoch if they just staked in it
Lets focus on this part of the function
With this check in place it will not be possible for users to unstake from the current epoch if they have some stake in it.
Lets take an example of a user that decides to stake in an epoch x then call the unstakeAll function, based on the check above this will not be possible, if the desire is to prevent users from staking immediately, then i will discuss some issues that will occur in another report.
Users will not be able to claim from current epoch
manual review
If the desire is to allow users to call this function even if they are unstaking immediately from current epoch then dont skip the epoch in the loop
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.