Unlike full settlements, when there are multiple people placing bids, the settlement fails for the user. This can be proven by running the test_partial_settlement test:
See the settleAskMaker function in the DeliveryPlace contract: https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L222-L325.
Now attach this POC to the end of https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/test/PreMarkets.t.sol
As shown by the test, whereas all other instances of this never fail, i.e calling settleAsMaker() in the case where we are attempting a partial settlement, the function reverts with an "Unauthorized" error.
Users who have placed bids may have their funds locked in the contract, unable to be settled or withdrawn, leading to potential financial losses. Also the inability to partially settle offers can lead to market inefficiencies, as large offers may remain unsettled for longer periods.
Manual review
Consider handlinng partial settlements correctly. This should include updating the offer's state to reflect partial settlements and ensuring that funds are distributed proportionally.
Valid high, in settleAskTaker/settleAskMaker, if the original offer maker performs a partial final settlement, the existing checks [here](https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/DeliveryPlace.sol#L356-L358) and [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L230-L232) will cause an revert when attempting to complete a full settlement, resulting in their collateral being locked and requiring a rescue from the admin. To note, although examples in the documentation implies settlement in a single click, it is not stated that partial settlements are not allowed, so I believe it is a valid user flow.
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.