The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Valid

LiquidationPoolManager::distributeFees can truncate decimal resolution due to division before multiply

Summary

LiquidationPoolManager::distributeFees() function does not priorities multiplication operation over division leading to loss of decimal resolution.
The fee for pool calculation can loose decimal resolution.

Vulnerability Details

In the below like, the division can happen before multiplication leading in loss of precision.

uint256 _feesForPool = eurosToken.balanceOf(address(this)) * poolFeePercentage / HUNDRED_PC;

Impact

feesForPool can be lower because of this lack in order of mathematics operation

Tools Used

Manual

Recommendations

Assign order of execution by add braces

uint256 _feesForPool = (eurosToken.balanceOf(address(this)) * poolFeePercentage) / HUNDRED_PC;
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

precision-distributeFees

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.