Tadle

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

Redundant and contradictory offer status check in DeliveryPlace::closeBidTaker() function

Vulnerability Details

The function contains two contradictory checks for the offer status in DeliveryPlace::closeBidTaker() function. The first check ensures that the offer status is Settled, but later in the code, there's a condition checking if the status is Virgin. This second check can never be true given the first check, making it redundant and potentially confusing.

[The first check here on line 143-145](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L143-L145)

if (offerInfo.offerStatus != OfferStatus.Settled) {
revert InvalidOfferStatus();
}

[The second check here on line 153](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/DeliveryPlace.sol#L153)

if (offerInfo.offerStatus == OfferStatus.Virgin) {

Recommendations

Remove the redundant check

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[invalid] finding-PreMarkets-closeBidTaker-Virgin-Settled-unreachable

Borderline informational/low severity, taker bid offers can only be closed after settlement by original makers, so the check for `Settled` offer status is correct but the initial `if` block is dead code and will never be reached i.e., even if original maker offer was not settled, this issue cannot be exploited. Additionally, makers are incentivized to settle original offers to earn maker bonuses from subsequent trades from the original maker offers by takers. Some issues such as 612, 1774 and 1775 have no impact described but I am duplicating anyways since I am invalidating this issue. Assigning as informational severity since I believe this can be seen as simply a waste of gas and confusing code logic.

Support

FAQs

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

Give us feedback!