Closed trungore closed 1 year ago
The underlying tokens with more than 18 decimals are unable to get price
https://github.com/LodestarFinance/lodestar-protocol/blob/relaunch-candidate/contracts/Oracle/PriceOracleProxyETH.sol#L114-L118
When the underlying token has more than 18 decimals, in this case, it will revert with underflow error.
} else if (aggregatorInfo.base == AggregatorBase.USD) { // Convert the price to ETH based if it's USD based. price = div_(price, Exp({mantissa: getPriceFromChainlink(ethUsdAggregator)})); uint256 underlyingDecimals = EIP20Interface(CErc20(cTokenAddress).underlying()).decimals(); return price * 10 ** (18 - underlyingDecimals);
Consider adding custom decimals for each underlying token
Acknowledged. For the time being we only offer assets with a maximum of 18 decimals. If in the future we had the desire to list an asset with more than 18 decimals, we will make the appropriate accommodations.
Title
The underlying tokens with more than 18 decimals are unable to get price
Affected smart contract
https://github.com/LodestarFinance/lodestar-protocol/blob/relaunch-candidate/contracts/Oracle/PriceOracleProxyETH.sol#L114-L118
Description
When the underlying token has more than 18 decimals, in this case, it will revert with underflow error.
Recommendation
Consider adding custom decimals for each underlying token