Normal Behavior:
The dsc_engine.vy contract calculates collateral value and liquidation amounts using formulas that assume all collateral tokens have 18 decimals.
Specific Issue:
The WBTC token configured in moccasin.toml has 8 decimals, not 18. The conversion logic in dsc_engine.vy (lines 317 and 363) does not normalize for token decimals. As a result:
1 WBTC (worth ~$100,000) is valued as only **$0.00001** — underestimating by a factor of 10^10.
The reverse conversion during liquidation is also wrong, allowing an attacker to repay a tiny amount of DSC and seize the borrower's WBTC.
The existing tests use 18-decimal mock tokens (mock_token.vy:30), so this issue is not covered.
Likelihood:
WBTC is already configured as a supported collateral with 8 decimals.
Any borrower using WBTC as collateral is immediately at risk.
No special permissions or extreme conditions are required.
Impact:
A borrower can be liquidated for almost nothing, losing their entire WBTC collateral.
The attacker pays a tiny amount of DSC and receives WBTC worth orders of magnitude more.
This is a direct theft of user funds.
The test deploys WBTC with 8 decimals and configures the engine to use it as collateral. Because the engine assumes 18 decimals, it values 1 WBTC at only $0.00001 instead of $100,000. When the borrower becomes liquidatable (due to another collateral's price drop), an attacker can repay a tiny amount of DSC and seize the borrower's WBTC. The assertion confirms the attacker receives WBTC for almost nothing.
The fix records each collateral's decimals at deployment and normalizes all amounts to 18 decimals before any valuation or liquidation calculation. This eliminates the 10^10 underestimation for WBTC (8 decimals) and ensures the liquidation amount is calculated correctly regardless of the collateral's native decimals.
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.