The function GMXOracle::_getTokenPriceMinMaxFormatted
in line#314 have converted the int256 result from Chainlink Oracle to uint256. Converting int256 to uint256 can have unexpected consequences when done unsafely.
The function GMXOracle::_getTokenPriceMinMaxFormatted
in line#314 have converted the int256 result from Chainlink Oracle to uint256. Converting int256 to uint256 can have unexpected consequences when done unsafely.
We are providing a similar scenario that can be reproduced in Remix:
In this case, when we input -23
as input to the function testUnsafeCasting
, it returns 115792089237316195423570985008687907853269984665640564039457584007913129639913
because of unsafe casting from int256 to uint256.
Protocol may experience unexpected output from the function GMXOracle::_getTokenPriceMinMaxFormatted
Manual Review, Remix
Use Openzeppelin SafeCast Library.
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.