DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Some checks pass under certain conditions when they shouldn't

Summary

Some comparisons are incorrect, leading to valid transactions being reverted.

Vulnerability Details

case 1: there is check in getPrice method inside ChainLinkUtil.sol

if (answer <= minAnswer || answer >= maxAnswer) {
revert Errors.OraclePriceFeedOutOfRange(address(priceFeed));
}

When answer is either equal to minAnswer or maxAnswer it should be not reverted because it is in range. But the function reverts is

case 2: Same case in checkPendingOrder inside MarketOrder.sol

if (self.timestamp != 0 && marketOrderMinLifetime != 0
&& block.timestamp - self.timestamp <= marketOrderMinLifetime) {
revert Errors.MarketOrderStillPending(self.timestamp);
}

Transaction should not be reverted when block.timestamp - self.timestamp isEqual to marketOrderMinLifetime, because that time period already passed.

Impact

This seems to be a rare case, but when it happens, valid transactions are reverted.

Tools Used

Manual Review

Recommendations

Replace >= with > and <= with <

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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

Give us feedback!