Core Contracts

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

Computation of `getUtilizationRate()` in contract `RaacMinter` is `WRONG`

Summary

The computation of Utilization Rate in raacMinter contract is wrong.
The issue is that, getNormalizedDebt() returns usageIndex from lendingPool contract which is directly assigned to variable totalBorrowed

Vulnerability Details

The function getUtilizationRate() is supposed to find out the current utilization rate of the system i.e. getUtilizationRate()

function getUtilizationRate() internal view returns (uint256) {
uint256 totalBorrowed = lendingPool.getNormalizedDebt(); //issue here
uint256 totalDeposits = stabilityPool.getTotalDeposits();
if (totalDeposits == 0) return 0;
return (totalBorrowed * 100) / totalDeposits;
}

Notice that, in order to calculate totalBorrowed, the contract makes a call to getNormalizedDebt() which belongs to lendingPool contract.

However, this function returns usageIndexinstead of total borrowed i.e. getNormalizedDebt()

function getNormalizedDebt() external view returns (uint256) {
return reserve.usageIndex;
}

This usageIndex MUST be multiplied with correct scaled borrowing to arrive at the final figure.

Impact

Incorrect Computation of Utilization rate would lead to assigning a wrong emission rate.

Tools Used

Manual

Recommendations

Consider computing the totalBorrowing by multiplying the usageIndex with respective scaledBalance to arrive at correct utilization rate.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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 4 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.