The oracle use to price Ethereum is a Chainlink aggregator proxy, meaning that the underlying oracle contract can be upgraded at any time, changing the number of decimals.
function proposeAggregator(address _aggregator)
external
onlyOwner()
{
proposedAggregator = AggregatorV2V3Interface(_aggregator);
}
Aggregator proxy can be updated at any time by owner. This means that the decimals of the aggregator can be change. All price calculations are hard coded for 8 dp and there is no way to change the oracle. The result of this is that a change in decimals would be catastrophic to DNFT.sol.
Recommendation
Use oracle.decimals() in place of 1e8 when calculating price
Summary
The oracle use to price Ethereum is a Chainlink aggregator proxy, meaning that the underlying oracle contract can be upgraded at any time, changing the number of decimals.
Proof of Concept
AggregatorProxy.sol#L355-L360
Aggregator proxy can be updated at any time by owner. This means that the decimals of the aggregator can be change. All price calculations are hard coded for 8 dp and there is no way to change the oracle. The result of this is that a change in decimals would be catastrophic to DNFT.sol.
Recommendation
Use oracle.decimals() in place of 1e8 when calculating price