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

Repeated Price Checks for the Same Token (Not Gas Friendly)

KeeperProxy.sol

Description:
In _validatePrice, the function calls _check twice for each of the index token and (by assumption) the long token, and twice for the short token:

_check(marketData.indexToken, prices.indexTokenPrice.min);
_check(marketData.indexToken, prices.indexTokenPrice.max);
_check(marketData.longToken, prices.indexTokenPrice.min);
_check(marketData.longToken, prices.indexTokenPrice.max);
_check(marketData.shortToken, prices.shortTokenPrice.min);
_check(marketData.shortToken, prices.shortTokenPrice.max);

Impact:
Under the current protocol assumption that the indexToken and longToken are the same, these duplicate checks add extra gas cost and increase the chance of spurious reverts if one of the two price bounds fluctuates. If market conditions are volatile, one of the two _check calls could revert even though the overall price range is acceptable. This isn’t a direct exploit but does tighten the operational window for keeper actions.

Recommendation:
Review whether both min and max values need to be checked separately. If the design expects both bounds to be within a narrow threshold, consider consolidating or adding a tolerance to avoid unnecessary reverts under normal market fluctuations.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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

Give us feedback!