Closed skarthik05 closed 6 months ago
Hi, thanks for the PR! However, this doesn't make sense.
The ETH/USD price feed has 8 decimal places, see here.
This means, that when we get a price back, let's say the price of ETH is $2,000. We'd get 2000 * (10 8). Because of this, we need to multiply this answer again by (10 10) to get 18 decimal places.
This PR would make the answer (10 * 8) (10 ** 18) which is WAY too big!
Description: This pull request corrects a potential error in the
getPrice
function within thePriceConverter
library. The function is responsible for converting the answer from the price feed to a uint256 value representing the ETH/USD rate.Changes:
10000000000
to10**18
to ensure that the result is in 18 decimal places.Impact:
PriceConverter
library.Reviewer: @PatrickAlphaC