When listing an offer in PreMarkert::listOffer
in Turbo Mode, the contract updates the AbortOfferStatus
to show that a sub-Offer has been listed but the variable(originOfferInfo
) is in memory hence this assignment is not stored in persitent Storage to be seen by other functions.
In PreMarkert::listOffer
, checks are made to see if the originOffer
of the maker of the stock to be listed is in turbo mode inorder to specify whether it has a subOffer
or not.
The information about this originOffer
is fetched and stored in a variable calledoriginOfferInfo
, but this variable is in memory but not storage;-
This makes the assignment below to be lost at the end of the function's excution, and the AbortOfferStatus
of this offer won`t change to be utilised/seen by other functions.
The originOffer's offerSettleType
won't be updated and will remain in initialized
after the end of the function execution making other function which check this state like preMarkets::abortAskOffer
unable to know the offer's collect state, hence can be aborted and collateral refunded, making the Sublisted
offer to be without collateral since its in turbo mode.
Manual Review
Consider changing the memory keyword to Storage in PreMarkert::listOffer
when an offer is in trubo mode to ensure all changes made to it are stored permanently.
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.