In DeliverPlace::settleAskTaker(), the msg.sender should be the stock's authority, not the preOffer's authority. Incorrect authority will cause settleAskTaker() dos.
In DeliverPlace::settleAskTaker(), the ask taker(seller) can settle the trade when the market place's status is AskSettling. The problem is that when we check access control for this function, we use _msgSender() != offerInfo.authority. This means that only the offer's authority has the permission to settle this ask taker. This is wrong, the actual msg.sender should be the ask taker(seller).
For example:
Alice creates one bid offer.
Bob matches Alice's offer via createTaker().
When the admin update market, and the market place's status is changed to AskSettling. Bob needs to settle ask taker via transferring point token into the capitalPool. But settleAskTaker() will be reverted, because Bob's stock's preOffer belongs to Alice. Bob does not have the permission to trigger settleAskTaker().
Add this function into PreMarkets.t.sol, and this function will be reverted because of Unauthorized().
user creates one bid offer.
user2 create one ask taker to match user's bid offer.
user2 call settleAskTaker and failed.
The ask taker cannot settle the trade. The core function will be blocked.
Manual
Correct the authority to check msg.sender is the stockInfo.authority.
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.