Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Invalid

Recommendation to check decimals <= 18

Summary

Inside ChainlinkARBOracle.consultIn18Decimals I would recommend to check decimals returns from consult is <= 18

Vulnerability Details

ChainlinkARBOracle.consultIn18Decimals calls consult, converts the result to uint256 and then divides by 10 ** _decimals.

If _decimals is > 18, there is a chance that the output of consultIn18Decimals returns a 0.

Impact

Returns incorrect price

Tools Used

Recommendations

Check that _decimals is <= 18 or handle the 2 cases separately.

Check _decimals is <= 18

return _answer.toUint256() * (10 ** (18 - _decimals))

Handle separately

if (_decimals <= 18) {
return _answer.toUint256() * (10 ** (18 - _decimals));
} else {
return _answer.toUint256() / (10 ** (_decimals - 18));
}
Updates

Lead Judging Commences

hans 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.