The AbortBidTaker
function doesn't do the same checks as the abortAskOffer
function regarding the market status and the offer type, this allow the user to call AbortBidTaker
at any moment, even when the market is offline.
The abortAskOffer
y AbortBidTaker
are functions that the user can call to cancel his respective offers and avoid settlement, this functions have to validate the orders are in certain states before allowing the user to abort his orders and return them their tokens.
The abortAskOffer
function do many checks prior to allow the user to abort his ask offer, some of the checks are:
checking that the offerType
is Ask, so the user can only cancel an ask offer.
Checking the market status is online, so the user can't abort an ask offer when the market is in another state.
The AbortBidTaker
do similar validations to ensure the order the user is trying to abort is in the correct state to allow the user to abort his order, but this function lacks the validation of the stockType
and the MarketPlaceStatus
like the abortAskOffer
does, this lack of validation allows any user to abort an order without checking the market status, so the user can abort an order on any state of the market, even when the market is offline.
also the stockType
order is not validated, so an user can abort an ask and a bid taker orders.
To show that a user can abort an order in any market state I added this test to the PreMarkets.t.sol, the test should revert but id doesn't.
users can abort Bid and Ask taker orders any moment, it doesn't matter the status of the market place, base con the code, the user should be able to abort only Bid taker orders when the market is online.
Manual Review.
Implement the complementary checks in the AbortBidTaker
for ensure the users can only abort a bid taker order and also validate that the market is in the required state.
Informational, during emergencies, even if abortions are allowed, withdrawal can be paused and collateral cannot be pulled anyways (`whenNotPaused` modifier within `withdraw()`), so there is no impact here, given funds outflow can be paused.
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.