The user can withdraw all of his funds while having an active market order in place thus allowing him to DOS the keeper when it tries to fill his order.
Steps to reproduce the issue:
User deposits funds
Opens market order
Withdraws funds
The market order is still present
Keeper tries to fillMarketOrder()
Transaction reverts
Make the following changes to simulateTrade.t.sol and run the test with forge test --mt test_dos_keeper_by_withdraw -vvvv
Market order keeper can be DOSed and user can withdraw his funds while having an active market order ready to be filled.
Manual Review
Upon withdraw check if the user has an existing market order for this market and check if the withdraw transaction should revert or clear the market order.
Be careful if you decide to clear the the market order in this situation because this should be under the condition that the minimum order lifetime has already passed.
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.