DeliveryPlace.settleAskMaker() allows Ask offer owner to send point tokens to protocol to settle offer and get back previously provided collateral tokens. This function has condition that checks whether provided amount of point tokens is the same as usedPoints of offer:
If user provides the same amount of point tokens as usedAmount then owner gets back collateral tokens., but if user provides less he becomes ineligible for getting back collateral tokens. For various reasons user can not provide promised amount of point tokens and would hope to get back as many collateral tokens as he provides.
This can happen if maker for some reason can not provide enough point tokens. For example:
protocol didn't give user enough point tokens
maker wanted to sell point tokens by having multiple account eligible in airdrop but some accounts (even 1) didn't get airdrop
user lost some point tokens in other unforeseen events (accidentally sending even 1 wei of point token would be enough to not get collateral tokens back)
protocol has a vesting and user can immediately withdraw only part of point tokens
Modify test/PreMarkets.t.sol test with the next code and execute this test with forge test --match-test test_settle_ask_maker_maker_lose_funds:
Allow offer owner to get refunded even for part of point tokens.
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.