Steadefi

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

UNSUPPORTED_TOKENS_WITH_MORE_THEN_18_DECIMALS

Summary

Protocol implicitly doesn't support tokens with more than 18 decimals

Vulnerability Details

If in function convertToUsdValue token that is converted to USD value has more than 18 decimals, subtraction 18 - IERC20Metadata(token).decimals() will fail

Token decimals are not checked in GMXVault.deposit, GMXDeposit.deposit, ...

Impact

Blockage for pairs with more than 18 decimals

Tools Used

Recommendations

Explicitly prohibit addition of tokens with more than 18 decimals. Assert correct decimals in convertToUsdValue and in functions that add tokens used later with convertToUsdValue. Consider to implement support for tokens with more than 18 decimals

Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Tokens with more than 18 decimals are not supported

Underflow in convertToUsdValue

Support

FAQs

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