The function distributeAssets performs division before multiplication, which can result in a loss of value of the variable costInEuros
In the function distributeAssets, first the value of the variable _portion is calculated as:
uint256 _portion = asset.amount * _positionStake / stakeTotal;
This variable is then used to calculate costInEuros. But, this value will be smaller than the value had it performed this calculation with multiplication before division.
Hence, a smaller value of costInEuros is calculated.
Incorrect value of costInEuros is used.
Manual review
Perform 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.