The distributeAssets
function in the LiquidationPool
contract may suffer from precision loss due to the order of operations involving division and multiplication. This could result in inaccurate calculations when distributing assets to holders based on their stakes.
In the distributeAssets
function, the calculation of _portion
involves division followed by multiplication, which can lead to precision loss. The relevant code snippet is as follows:
The purpose of this calculation is to determine the portion of an asset to be distributed to a specific holder based on their stake. However, due to the order of operations, the intermediate result _portion
may lose precision, impacting the accuracy of the final distribution.
The precision loss in the asset distribution calculation may result in inaccurate distribution of assets to holders, potentially affecting the fairness and reliability of the liquidation pool system.
Manual
The order of operations should be adjusted to prioritize multiplication before division.
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.