A user can unstake a deposit in 2 situations :
A deposit can be unstaked in two cases: if it has waited for 6 epochs or if the deposit was made during the same epoch as the unstake call.
The problem is that the unstakeAll function(L-570) ignore all the deposits that didn't wait at least 6 epoch.
When a user call unstakeAll it will loop over all the activeDeposit of the sender it will check if the activeDeposit is old enought to unstake it as we can see here :
the proble here is that the if statement will make the function ignore the activeDeposit if it has been made in the same epoch as the unstakeAll call.
This contradicts the unstake function(L-449) as we can see here :
You can run this test in the StakeRewardScenarios contract in the StakeReward.t.sol file :
The function UnstakeAll don't unstake all the unstakable deposits.
Echidna
You can just add a if statement that make sure that the function unstake the deposit of the current 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.