Both the health-factor calculation and the USD-to-token conversion perform integer division that truncates toward zero, with the divisions ordered so that small positions lose precision.
_get_token_amount_from_usd floors the result, so a liquidator covering a tiny debt can receive 0 collateral, and the threshold multiply-then-divide loses up to LIQUIDATION_PRECISION-1 of value per position.
Likelihood:
Low. The error is bounded to wei-scale dust for normal magnitudes; it only becomes material with very small amounts or very high-priced collateral.
Impact:
Low. Rounding can let a borrower hold a few wei of unbacked DSC or cause a liquidator to receive slightly less collateral than owed. No large-scale theft, but it erodes the strict invariant and can leave non-zero un-liquidatable dust debt.
Convert a sub-price USD amount and observe truncation to zero.
Multiply before dividing and/or document the rounding direction so it always favors the protocol.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.