The abortAskOffer function allows an ask offer maker to abort their offer and reclaim their collateral, while takers of the offer can retrieve their deposits. In Turbo mode, if an original offer has subsequent trades, it cannot be aborted. To enforce this, the listOffer function attempts to update the status of the original offer to SubOfferListed when a sub-offer is created from an original Turbo mode offer, this is intended to prevent the original offer from being aborted when calling abortAskOffer. The issue is that listOffer does not correctly update the origin offer status to SubOfferListed:
In the above code, the originOfferInfo variable is incorrectly defined with the memory keyword instead of storage. As a result, the update originOfferInfo.abortOfferStatus = AbortOfferStatus.SubOfferListed; does not persist after the transaction, making the original offers in Turbo mode incorrectly abortable.
The listOffer function does not update the abort status of the original offer, allowing offers in Turbo mode with subsequent offers to be aborted when they should not be.
Manual Review
Update the originOfferInfo variable's location from memory to storage:
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.