Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: high
Invalid

Incorrect offer status is set while closing a bid offer

Summary

Incorrect offerStatus is set while closing a bid by calling DeliveryPlace::closeBidOffer().

Vulnerability Details

The closeBidOffer() is called by the owner of a bid offer when they want to close that offer, after calling this function the price, which was deposited by the Maker while listing the offer but was not used for buying points, are sent back to the Maker i.e is refunded. But to note, in this stage the offer is not settled, offer will be settled when the taker i.e the seller of the points to Maker will settle the stock, by calling settleAskTaker(). But after the execution of the closeBidOffer() the offerStatus is changed to offerStatus.settled, but the status should be offerStatus.settling.

Tools Used

Manual review.

Recommendations

Change the status to offerStatus.settling instead of offerStatus.settled.

Related links

  1. https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L79

  2. https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/storage/OfferStatus.sol#L21

Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.