When withdrawing LST for asset tokens, _withdraw() uses _shouldQueueWithdrawal to check whether a withdrawal should be queued if the the full amount cannot be satisfied. If _shouldQueueWithdrawal is set to false, the function reverts instead of refunding the LST back to the user since the withdrawal cannot be fulfilled.
In _withdraw(), the function first checks that there is any deposit tokens queued and withdraw asset tokens from there. If there are still tokens left to be withdrawn, the function will call queueWithdrawal() if _shouldQueueWithdrawal is set to true. Otherwise, the function reverts.
Note that the caller calling withdraw() has to deposit all the LST into the contract first.
For example, Alice calls withdraw and deposits 100 LST to the contract because she wants to withdraw 100 LST. There are 60 asset in queue. She will get 60 asset back first (assuming 1:1 conversion). For the remaining 40 LST, if she sets _shouldQueueWithdrawal to true, then she has to wait for the 40 assets. If she sets to false, the whole function reverts.
The function should refund the 40 LST back to Alice instead of reverting.
_shouldQueueWithdrawal always reverts if set to false.
Manual Review
Instead of reverting, return with the remaining toWithdraw amount and add another line in withdraw() to refund the remaining LST back to the caller.
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.