Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

`balanceIncrease` incorrectly calculated on DebtToken, using rayMul() twice

Vulnerability Details

At DebtToken::mint(), the balanceIncrease is wrongly calculated as the code does a rayMul() twice over the scaledBalance of a user.

This happens because when fetching scaledBalance here. Balance of is called which already multiplies by index, see here.

And then in the next lines of code, if some debt was accrued and a balanceIncrease must be calculated the code uses the same scaledBalance multiplied again, see here.

Impact

User is minted more accrued debt than it should.

Recommendations

Only do the rayMul() once when calculating the balanceIncrease.

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

DebtToken::mint miscalculates debt by applying interest twice, inflating borrow amounts and risking premature liquidations

Support

FAQs

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