LiquidationPool::distributeAssets()
incorrectly assumes prices returned from Chainlink oracles all come in 8 decimal format. This is inaccurate, as the decimal count may vary across different feeds.
The following calculations from LiquidationPool::distributeAssets()
are affected by this:
L207:
The calculation for costInEuros
incorrectly scales the cost because it assumes the prices from oracles are returned with 8 decimals.
Wrongly updated EUROs positions of all stakers
Wrong amount of EUROs being burned from the contract
Wrong reward distribution
Manual Analysis
Apply a decimal correction for all prices consumed from oracles. While all of the feeds specified in the docs use 8 decimals, I wouldn't recommend hard-coding the count to 8. Instead, you should use Chainlink.AggregatorV3Interface.decimals()
and apply the correction for each individual price feed.
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.