This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
PRAISE - possible precision loss in D3VaultLiquidation.finishLiquidation() function when calculating realDebt because of division before multiplication #45
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Will Fix
The sponsor confirmed this issue will be fixed
PRAISE
medium
possible precision loss in D3VaultLiquidation.finishLiquidation() function when calculating realDebt because of division before multiplication
Summary
finishLiquidation() divides before multiplying when calculating realDebt.
Vulnerability Detail
There will be precision loss when calculating the realDebt because solidity truncates values when dividing and dividing before multiplying causes precision loss.
Values that suffered from precision loss will be updated here
Impact
Values that suffered from precision loss will be updated here
Code Snippet
https://github.com/sherlock-audit/2023-06-dodo/blob/main/new-dodo-v3/contracts/DODOV3MM/D3Vault/D3VaultLiquidation.sol#L144
https://github.com/sherlock-audit/2023-06-dodo/blob/main/new-dodo-v3/contracts/DODOV3MM/D3Vault/D3VaultLiquidation.sol#L147
Tool used
Manual Review
Recommendation
don't divide before multiplying
The text was updated successfully, but these errors were encountered: