The UpliftOnlyExample::getPoolLPTokenValue function's double price scaling leads to inflated LP token deposit values being stored in poolsFeeData, even though this doesn't affect fee calculations. This creates inconsistency in stored historical data and could cause issues if these values are used for other purposes.
Taking a look at OracleWrapper contract, it suggests that oracle data is normalized to 18 decimals as seen in the comment below
These 18 decimal places normalization is even evident in the ChainlinkOracle as seen below
But on the contrary, in the function getPoolLPTokenValue in the UpliftOnlyExample contract the prices are being scaled again.
Note hat the FixedPoint mulUp and mulDown are both processing FixedPoint numbers which are 18 decimals but the priceScaled18 will have 36 decimals.
As a result the value for depositValue when an LP adds Liquidity will be stored in the poolsFeeData mapping as a largely inflated value.
Historical deposit values stored in poolsFeeData are inflated by a factor of 1e18, creating inconsistency in stored data
Manual Review
Remove the redundant scaling to store correct historical values:
Order of magnitude: Price = 1e18 (already scaled and normalized by ChainlinkOracle). PriceScaled = 1e36 PoolValueInUSD = 1e36 (mulDown) PoolTotalSupply = 1e18 PoolValueInUSD / PoolTotalSupply = 1e18. Everything seems fine here.
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.