The settleAskMaker
function contains a critical inconsistency in how it handles the partial fetching of tokens from the maker and the logic surrounding maker refunds. Specifically, the function fetches partial tokens from the maker even when the maker is not eligible for a refund unless all used points are settled. This inconsistency can lead to scenarios where the maker loses collateral without receiving a corresponding refund. Due to this, maker wouldn't settle any points if they can't settle all points because he wouldn't be getting his collateral back unless he settles all points.
The function fetches partial tokens from the maker using the tokenManager.tillIn
method, even when the maker is not settling all used points. However, the maker will not receive a refund unless all used points are settled. This inconsistency suggests that the maker might lose tokens without any possibility of a refund, which is unfair and could lead to unexpected financial losses for the maker.
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/DeliveryPlace.sol#L265-L307
Loss of funds of maker
if they are trying to settle partial points.
Manual review
The logic needs to be clarified and aligned to ensure that if the maker is not settling all used points and is not eligible for a refund, no partial tokens should be fetched from them. Alternatively, if partial settlement is allowed, then a corresponding partial refund should be calculated and provided to the maker.
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.