The function checks for offerInfo.offerStatus == OfferStatus.Virgin in the collateral fee calculation. However, earlier in the function, there's a check that requires the offer status to be Settled.
The function checks for offerInfo.offerStatus == OfferStatus.Virgin in the collateral fee calculation. However, earlier in the function, there's a check that requires the offer status to be Settled. This means that the condition offerInfo.offerStatus == OfferStatus.Virgin will never be true, making the first branch of the collateral fee calculation unreachable.
The first branch of the collateral fee calculation will never be executed.
Manual Review
Remove the check for Virgin status in the collateral fee calculation, or adjust the earlier offer status check to allow for both Settled and Virgin statuses, if that's the intended behavior.
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.
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.