The `FjordStaking::unstakeAll` function does not allow users to unstake tokens from the current epoch (when `dr.epoch == currentEpoch`), unlike the regular `FjordStaking::unstake` function, which does support this. This inconsistency could lead to confusion and prevent users from fully unstaking their tokens in a single transaction.
Specifically, the `unstakeAll` function includes a condition that skips over any deposits from the current epoch, thus preventing users from unstaking these tokens in one transaction
In the `FjordStaking::unstakeAll` function, the logic only allows unstaking from epochs that are older than the current epoch (`currentEpoch - epoch > lockCycle`). This means that users who have deposited tokens in the current epoch are unable to unstake all their tokens including the one deposited in that epoch in a single transaction. using `unstakeAll`.
The regular `FjordStaking::unstake` function, on the other hand, includes a condition that allows immediate unstaking if `dr.epoch == currentEpoch`, providing more flexibility for users.
In the natspec of our `unstake` function we wrote `// _epoch is same as current epoch then user can unstake immediately` . So by system, a user is suppose to Unstake tokens that were staked in the current epoch.
This discrepancy in behavior could confuse users, as they might expect to be able to unstake from the current epoch using `FjordStaking::unstakeAll`, just as they can with `FjordStaking::unstake`
Users who have staked tokens in the current epoch may find themselves unable to fully unstake their holdings in a single transaction using `unstakeAll`, potentially leading to frustration or misuse of the staking platform.
Manual Review
Consider modifying the `FjordStaking::unstakeAll` function to include logic that allows for unstaking from the current epoch when `dr.epoch == currentEpoch`. This change would make the behavior consistent with the regular `FjordStaking::unstake` function and provide a more intuitive user experience.
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.