Handsome Wool Bat
Medium
Function undelegateStake
is used to cancel the delegation for _msgSender
and set the unlockEpoch
. When the delegatee is already removed, unlockEpoch = currentEpoch() + 1
, and when the delegatee is not removed, unlockEpoch = currentEpoch() + 1 + undelegateLockEpochs
. Then in the claimUndelegation
function, it will be checked whether unlockEpoch is less than or equal to currentEpoch.
However, when the delegatee is removed after the user calls undelegateStake
, the user's unlockEpoch remains unchanged, which means that the user will wait more time before claiming.
For example, when currentEpoch = 10
, undelegateLockEpochs = 10
, user calls undelegateStake
, so the unlockEpoch will be 10+1+10 = 21
. Later, when currentEpoch = 11
, the delegatee is removed. At this point users should be allowed to claim at currentEpoch = 12
. But in fact, users can only claim it after currentEpoch >= 21
.
It is worth noting that the user cannot call undelegateStake
again, which makes the user unable to update unlockEpoch.
After the delegatee is deleted, the user needs to wait more time to claim. At the same time, the user cannot update the unlockEpoch.
No response
- User calls undelegateStake
- removeStakers is called.
No response
User has to wait more time to claim.
No response
Allows the user to update unlockEpoch after the delegatee is removed.