The abortAskOffer() function in PreMarkets.sol is used to abort an ask offer.
A turbo offer isn't allowed to be aborted after it's listed, and the listOffer() function has a check to set the abortOfferStatus of the offer to AbortOfferStatus.SubOfferListed if it's a turbo offer that has been listed.
However, it modifies the abortOfferStatus of originOfferInfo in memory instead of storage. This means the change is not persisted to the contract's state:
This is the check in abortAskOffer() that should ensure that only not-listed turbo offers can be aborted:
As a result, even after a turbo offer is listed, it can still be aborted, which contradicts the intended behavior and allows users to abuse the system by aborting listed turbo offers and breaking chain of offers. Moreover, takers won't get reimbursed the platform fee and trade tax they paid and thus lose funds.
Disruption of protocol functionality and takers lose the TradeTax (maker bonus) and PlatformFee they paid.
Add this PoC in test/PreMarkets.t.sol and run forge test --mt test_PoC_SubOfferListed -vvvv
Modify the abortAskOffer() function to update the state variable instead of the memory variable:
Valid high severity, because the `abortOfferStatus` of the offer is not updated and persist through `storage` when listing an offer for turbo mode within the `offerInfoMap` mapping, it allows premature abortion given the `abortOfferStatus` defaults to `Initialized`, allowing the bypass of this [check](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L552-L557) here and allow complete refund of initial collateral + stealing of trade tax which can potentially be gamed for profits using multiple addresses
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.