Core Contracts

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

LendingPool protocol fee is not properly handled

Summary

LendingPool protocol fee is not properly handled.

Vulnerability Details

LendingPool contains protocolFeeRate which is initialized to 0 but can be updated to non-zero.

LendingPool.sol::setProtocolFeeRate()

function setProtocolFeeRate(uint256 newProtocolFeeRate) external onlyOwner {
rateData.protocolFeeRate = newProtocolFeeRate;
}

The protocol fee is charged on user's profit earned from borrowing interest.

ReserveLibrary.sol::calculateLiquidityRate()

function calculateLiquidityRate(uint256 utilizationRate, uint256 usageRate, uint256 protocolFeeRate, uint256 totalDebt) internal pure returns (uint256) {
if (totalDebt < 1) {
return 0;
}
uint256 grossLiquidityRate = utilizationRate.rayMul(usageRate);
@> uint256 protocolFeeAmount = grossLiquidityRate.rayMul(protocolFeeRate);
@> uint256 netLiquidityRate = grossLiquidityRate - protocolFeeAmount;
return netLiquidityRate;
}

The problem is that protocl fee is not recorded separately, nor there is dedicated function implemented for withdrawing the fees.

Impact

Because protocol fee is not properly recorded, it's very hard to know how much fee has been collected so far.

As there is no function for withdrawing protocol fee, the fee is stuck in RToken contract.

Tools Used

Manual Review

Recommendations

It is recommended to record protocol fee properly, and implement functionality to withdraw the fee.

Updates

Lead Judging Commences

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

LendingPool calculates protocol fees but lacks mechanism to track and withdraw them, causing fees to be permanently locked in the RToken contract

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

LendingPool calculates protocol fees but lacks mechanism to track and withdraw them, causing fees to be permanently locked in the RToken contract

Appeal created

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

LendingPool calculates protocol fees but lacks mechanism to track and withdraw them, causing fees to be permanently locked in the RToken contract

Support

FAQs

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

Give us feedback!