Precision loss in LiquidationPool.sol
::distributeAssets
. Users will lose significant rewards when assets are distributed.
Due to solidity's floating point issue ie. truncation of extra decimal points. The calculation ordering would lead to significant loses for uses.
uint256 costInEuros = _portion * 10 ** (18 - asset.token.dec) * uint256(assetPriceUsd) / uint256(priceEurUsd) * _hundredPC / _collateralRate;
There is division before multiplication which would lead to precision errors for the users and am imbalance in liquidity.
the contract's economic model could be affected due to compounded rounding errors, which might lead to undesirable financial outcomes for the users and the contract's balance.
Manual Review
- uint256 costInEuros = _portion * 10 ** (18 - asset.token.dec) * uint256(assetPriceUsd) / uint256(priceEurUsd) * _hundredPC / _collateralRate;
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.