GMXOracle._getTokenPriceMinMaxFormatted
will not work if tokenDecimals+ _priceDecimals
> 30
GMXOracle._getTokenPriceMinMaxFormatted
function extracts the token price from chainlink oracle and normalizes it to 1e30:
Assuming that the used tokens in the protocol are of a maximum decimal of 18; then if the returned _priceDecimals
is > 12; this will make _getTokenPriceMinMaxFormatted
revert.
And since this function is used in GMXOracle.getAmountsOut
& GMXOracle.getMarketTokenInfo
functions; this will result in disabling these functions too.
Since most of the calculations in the GMXReader
library are heavily dependent on these functions; this will disable the protocol from functioning if the IERC20Metadata(token).decimals() + _priceDecimals
is > 30.
GMXOracle._getTokenPriceMinMaxFormatted function
Manual Review.
Update GMXOracle._getTokenPriceMinMaxFormatted
function to handle the aforementioned scenario.
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.