The user forked this code to support arbitrary assets; it functions normally, including liquidation and settlement.
The code assumes a default decimal of 18 and does not normalize for other decimal values.
Likelihood:
The current deployment uses WETH and WBTC, both of which have 18 decimals — the vulnerability is not triggered in the default configuration. However, the codebase is explicitly designed to be forked and extended to support arbitrary collateral assets (as noted in the comment on line 18). Any fork that adds a non-18-decimal token (e.g., USDC/USDT at 6 decimals, WBTC on some chains at 8 decimals) will activate this bug immediately without any additional attacker action. The trigger condition is a routine protocol configuration step, not a sophisticated exploit.
Impact:
The severity of the outcome is high in both directions depending on token decimals:
Decimals < 18 (e.g., USDC = 6): Collateral value is understated by 10^18−d10^18−d. A user depositing $1,000,000 in USDC receives a health factor near zero and cannot mint any DSC. The collateral is effectively locked with no functional use — complete loss of utility for that token.
Decimals > 18: Collateral value is overstated by 10d−1810d−18. A user can mint DSC far in excess of real collateral value, breaking the overcollateralization invariant and directly threatening DSC's USD peg.
Both scenarios also corrupt _get_token_amount_from_usd(), meaning liquidation payouts are calculated incorrectly — liquidators receive the wrong token amount, making the liquidation mechanism unreliable.
Deposit 1,000 USDC (6-decimal token, real value = $1,000)
get_usd_value() returns 1e9 instead of the correct 1e21 — a 10¹² undervaluation
Root cause: the formula (price * 1e10 * amount_raw) // 1e18 assumes amount_raw is always in 18-decimal units; for a 6-decimal token, amount_raw = 1e6 instead of 1e18, so the result is scaled down by 10^(18-6) = 10^12
Consequence: the user's max mintable DSC is 5×10⁸ wei (~0 DSC) instead of the correct 500 DSC
The final assert max_mintable_reported < 1e18 proves that even minting 1 DSC will revert due to an artificially broken health factor, locking out any user depositing non-18-decimal collateral
Obtain the precision of the current input token, performing normalization during calculation.
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.