DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

`depositMargin` enforces marginCollateralConfiguration.depositCap BUT does not scale up the `depositCap` to 18 decimals before comparing it to scaled up `amountX18`

Vulnerability Details

All collateral tokens have an associated depositCap

The total deposits can never exceed this depositCap, it is enforced in depositMargin as follows

_requireEnoughDepositCap(collateralType, amountX18, depositCapX18, totalCollateralDepositedX18);

The issue is that amountX18 and totalCollateralDepositedX18 are values scaled up to 18 decimals if the collateral token has < 18 decimals BUT depositCapX18 is never scaled up.

Impact

depositCap will be easily surpassed for tokens with < 18 decimals

Tools Used

Manual Review

Recommendations

Scale up depositCapX18 by the appropriate number of decimals

Updates

Lead Judging Commences

inallhonesty Lead Judge
12 months ago
inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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