settleAskTaker should only be called by the stock owner but currently it allows only the owner of the offer to call this function hence wrong access control check.
Following is settleAskTaker function
As can be seen from the comments that only stock owner can call this function
So wrong check in the following line
Also why is it should be called by the stock owner is because in this case the stock owner is selling points so only he should be settling the offer. Hence he would be paying the settledPointTokenAmount.
Also if the function was supposed to be called by the offer owner then the following code logic wouldn't make sense
As it would essentially mean that offer owner is transferring the token and increasing its own balance and then he withdraws it back, thus no point of sending the tokens in the first place.
Wrong access control check.
Manual review
Change the check allowing only stock owner to call this function.
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.