Core Contracts

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

Incorrect `totalBorrowed` amount is used in the `RAACMinter::getUtilizationRate` function.

Summary

totalBorrowed is incorrect because the getNormalizedDebt function returns an index value, not totalBorrowed amount.

Vulnerability Details

The getNormalizedDebt function returns an index, not the totalBorrowed amount, as implemented in the LiquidityPool contract.

Using the index value instead of the totalBorrowed amount will cause incorrect calculations in getUtilizationRate, as this function should return the utilization of deposits. The index value will lead to incorrect results.

/**
* @notice Gets the reserve's normalized debt
@>> * @return The normalized debt (usage index)
*/
function getNormalizedDebt() external view returns (uint256) {
@>> return reserve.usageIndex;
}
function getUtilizationRate() internal view returns (uint256) {
@>> uint256 totalBorrowed = lendingPool.getNormalizedDebt();//- this is wrong in lending piil
uint256 totalDeposits = stabilityPool.getTotalDeposits();
if (totalDeposits == 0) return 0;
return (totalBorrowed * 100) / totalDeposits;
}

Impact

The totalBorrowed value is incorrect, leading to wrong calculations in getUtilizationRate, which will return an incorrect utilization rate.

Recommendations

Use the correct function to get the totalBorrowed value in the getUtilizationRate function.

Or modify the getNormalizedDebt function to return the totalBorrowed amount.

Updates

Lead Judging Commences

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

RAACMinter::getUtilizationRate incorrectly mixes stability pool deposits with lending pool debt index instead of using proper lending pool metrics

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

RAACMinter::getUtilizationRate incorrectly mixes stability pool deposits with lending pool debt index instead of using proper lending pool metrics

Support

FAQs

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

Give us feedback!