BID offers buy their points instead of receiving them, resulting in a loss of user funds (they pay to get nothing in return).
Alice creates a BID offer for 1000 points and 2000 collateral
Bob creates an ASK order to sell 400 points, he sends 800 collateral
Alice settles 400 points on Bob's order. The problem is, that she must send her own 400 points to close the order
Alice closes her BID offer
Alice paid collateral to receive back her own points. Bob never transferred any points.
Poc, run forge test --via-ir --match-test test_h4_offer_bid_buy_their_own_points -vv
Impact: High (High loss of user funds)
Likelihood: High (It will happen without pre-conditions)
Risk: Critical
Manual Review
In DeliveryPlace
, the BID offer maker shouldn't send any tokens, as they are buying them:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/DeliveryPlace.sol#L377-L382
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.