Core Contracts

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

Locked Protocol Fees in LendingPool Contract

Summary

In the LendingPool contract a portion of interest payments reserved for protocol fees, becomes permanently locked due to a missing mechanism for accessing or utilizing these accumulated funds. This results in lost revenue for the protocol and an inefficient distribution of funds.

Impact

  • Locked Funds: The protocol fees are deducted but never transferred, withdrawn, or made accessible.

Vulnerability Details

Code Location

The issue originates in the calculateLiquidityRate function:

function calculateLiquidityRate(uint256 utilizationRate, uint256 usageRate, uint256 protocolFeeRate, uint256 totalDebt) internal pure returns (uint256) {
if (totalDebt < 1) {
return 0;
}
// @audit it should be divided to one Ray
uint256 grossLiquidityRate = utilizationRate.rayMul(usageRate);
uint256 protocolFeeAmount = grossLiquidityRate.rayMul(protocolFeeRate);
uint256 netLiquidityRate = grossLiquidityRate - protocolFeeAmount;
return netLiquidityRate;
}

Root Cause

  • The function calculates the protocol fee but does not provide a way to transfer or allocate it.

  • The protocolFeeAmount is deducted from the gross liquidity rate but is not stored or accessible anywhere in the contract.

  • No function exists in LendingPool to claim or distribute these accumulated fees.

Attack Scenario

  1. Borrowers pay interest, and a portion is reserved for protocol fees.

  2. These fees are being held in the contract.

  3. The funds remain locked indefinitely.

  4. The protocol loses revenue as fees cannot be accessed or utilized.

Suggested Fix

To resolve this issue, the contract should:

  1. Implement a mechanism to transfer the reserved protocol fee to a designated address.

  2. Introduce a function for the protocol administrator to claim accumulated fees.

  3. Modify calculateLiquidityRate to ensure protocol fees are stored properly.

Updates

Lead Judging Commences

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

Protocol fees are deducted from depositor returns in liquidity rate calculations but never collected/transferred to protocol treasury, causing value loss

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

Protocol fees are deducted from depositor returns in liquidity rate calculations but never collected/transferred to protocol treasury, causing value loss

Support

FAQs

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

Give us feedback!