The DeliveryPlace::settleAskMaker(...)
allows a user to enter the amount points they want to settle within the limit of usedPoint
of their _offer
. If a user decides to settle in bits they will not be able to settle their outstanding usedPoints
because DeliveryPlace::settleAskMaker(...)
will revert.
As shown in the code snippet above, DeliveryPlace::settleAskMaker(...)
makes an internal call to PreMarkets::settleAskOffer(...)
to update the offer's settlement for ASKs. As shown below, the offerInfo.offerStatus
is updated to OfferStatus.Settled
so when settledAskOffer
is called.
Alice has 1000 point to settle
she first calls DeliveryPlace::settleAskMaker(...)
with 500 points
she attempts to call DeliveryPlace::settleAskMaker(...)
with the remaining 500 points but the transaction revert.
Admin has access to the function for all users and calls DeliveryPlace::settleAskMaker(...)
on behalf of Alice but the function reverts becuase the offerInfo.offerStatus is neither Cancelled
nor Virgin
** CODED POC**
Add the test case below to the PreMarkets.t.sol
file and run forge test --mt test_ask_offer_settle_revert -vvv
DoS on Delivery market (could also lead to possible stuck funds)
Manual review
Prevent users from entering the amount of point they want to settle. Instead they should settle all available offerInfo.usedPoints
as shown below when settleAskMaker(...)
is called.
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.