Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: medium
Invalid

Offer cannot be relisted if called with closeBidOffer whereas it can be relisted if called with CloseOffer

Summary

There are more than one ways to close the offer, but only one of the methods sets the offer to a state where it can be relisted again. This is inconsistent with the expected behaviour of the function as an user who isn't aware will not be able to relist his offer again.

Vulnerability Details

The offer created if closed can be relisted via relistOffer method in PreMarkets.sol. However The offer can be closed in two ways, namely via closeBidOffer and closeOffer.

When closing the bid offer through closeOffer, the state of the offer is set to OfferStatus.Canceled.

When closing the bid offer through closeBidOffer, the state of the offer is set to OfferStatus.Settled.

However, there is a check in relistOffer that says that offer has to be in the state of Canceled for it to continue.

@> if (offerInfo.offerStatus != OfferStatus.Canceled) {
//@audit what about settled offer status?
revert InvalidOfferStatus();
}

Impact

The user cannot relist his offer again if he tries to close the bid offer using closeBidOffer instead of closeOffer.

Tools Used

Manual analysis

Recommendations

Set the state to OfferStatus.Cancelled in closeBidOffer

Updates

Lead Judging Commences

0xnevi Lead Judge
10 months ago
0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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