Broken core functionality
Function does not work as designed
Users who want to unstake may have their funds locked
The unstakeAll function does not unstake current epoch stakes.
The unstakeAll function, as the name suggests, should unstake all available rewards.
However, this function only unstakes stakes that were made lockCycle epochs ago, even though any stake in the current epoch is instantly redeemable.
This will cause users to not actually unstake all of their assets, but only the old stakes.
Example:
A user has 3 different stakes, all of which have passed the lock period and can be unstaked.
He stakes at the beginning of the epoch.
Near the end of the epoch, he wants to unstake all his assets, so he calls unstakeAll.
The function only unstakes his 3 previous deposits, not touching the one he made at the beginning of this epoch.
Now the user needs to wait to get his stake unlocked.
The user will become dissatisfied and may never use the protocol again.
The unstakeAll function is missing the functionality to unstake current epoch stakes.
Manual review
Add the functionality for unstakeAll to unstake tokens that were staked this epoch.
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.