In a case where a user calls PriorityPool::withdraw
function with _shouldUnqueue
and _shouldQueueWithdrawal
as true booleans, with enough _amountToWithdraw
that it has to go to the last stage of withdrawal: queueWithdrawal. And in the last step, if not enough amount is left, the whole withdrawal process will revert.
The user calls PriorityPool::withdraw
with both _shouldUnqueue
and _shouldUnqueue
set as true.
The first deduction of the amount will be made: toWithdraw -= amountToUnqueue
Tokens are remaining after unqueueing, next step PriorityPool::_withdraw
is called.
Let's say totalQueued != 0
so a second deduction is made: toWithdraw -= toWithdrawFromQueue
toWithdraw
is still not zero, so WithdrawalPool::queueWithdrawal
is called (Notice that they don't have a choice to set _shouldQueueWithdrawal
as true otherwise it will revert). If toWithdraw
remaining amount is too low at this stage, the whole process will revert, and the user can do nothing about it since both the priority queue and withdrawal queue deductions are out of their control, relying on dynamic conditions.
Users won't be able to withdraw if the remaining amount gets too low after the deductions. Because these deductions depend on changing conditions, there's no way for users to control or predict when the process will fail.
Manual Review
I do not have a suitable recommendation for this
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.