The createOffer
function for BID offers is supposed to allow users to place and match orders for buying point tokens. However, this flow is not functioning as intended, unlike the createOffer
for ASK offers, which allows the Maker to createOffer for selling point tokens. There is a problem with the createOffer
for BID and thesettleAskTaker
function, which is supposed to complete the settlement process after the Token Generation Event (TGE). The issue lies in the fact that settleAskTaker
is only callable by the Maker, who is incorrectly expected to send the point tokens. This misalignment results in the function potentially reverting if the Maker does not have the point tokens, which is likely, given that the tokens should be sent by the Taker, and loss of the point tokens if the Maker has the points tokens.
The settleAskTaker
function is designed to be called by the Maker to finalize the settlement of point tokens after the TGE. However, in the context of a BID offer, the Taker is supposed to provide the point tokens. The current implementation mistakenly expects the Maker to hold and transfer the point tokens, which contradicts the intended flow where the Maker is the buyer, not the seller.
Issues
The createOffer for BID makes the Maker the owner of the stock authority.
The settleAskTaker can only be called by stock authority or contract owner
If Maker calls the settleAskTaker function, the transaction will revert or the maker will lose point tokens
Users will not be able to complete BID offers.
Manual Review
Valid high severity, when taker offers are created pointing to a `offer`, the relevant `stockInfoMap` offers are created with the owner of the offer aka `authority`, set as the creater of the offer, as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L245). Because of the wrong check within settleAskTaker, it will permanently DoS the final settlement functionality for taker offers for the maker that listed the original offer, essentially bricking the whole functionality of the market i.e. maker will always get refunded the original collateral, and takers will never be able to transact the original points put up by the maker. This occurs regardless of market mode.
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.