Core Contracts

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

Unused mintRewards() Function in Stability Pool

Summary

The mintRewards() function in LendingPool.sol is designed to mint RAAC rewards and can only be called by the StabilityPool contract. However, the function is never actually called by StabilityPool.sol, rendering it ineffective. This oversight prevents the intended reward distribution mechanism from functioning correctly.

Vulnerability Details

Affected Function:

mintRewards(address recipient, uint256 amount) in RAACMinter.sol

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/minters/RAACMinter/RAACMinter.sol#L181-L193

The function mintRewards() is intended to reward users by minting RAAC tokens to a specified address. It includes an access control mechanism that restricts calls to the StabilityPool contract. However, upon reviewing the codebase, it was found that StabilityPool.sol does not call this function at any point, leaving it unused.

Root Cause:

  • The contract defines a function for minting rewards but never invokes it.

  • This results in no RAAC rewards being distributed, leading to a flawed incentive mechanism.

Code Snippet:

function mintRewards(
address to,
uint256 amount
) external nonReentrant whenNotPaused {
if (msg.sender != address(stabilityPool)) revert OnlyStabilityPool();
uint256 toMint = excessTokens >= amount ? 0 : amount - excessTokens;
excessTokens = excessTokens >= amount ? excessTokens - amount : 0;
if (toMint > 0) {
raacToken.mint(address(this), toMint);
}
raacToken.safeTransfer(to, amount);
emit RAACMinted(amount);
}

Proof of Concept (PoC)

Preconditions:
  • The mintRewards() function exists in LendingPool.sol.

  • StabilityPool.sol is supposed to call it to distribute RAAC rewards.

Steps to Trigger:
  1. Check all instances where mintRewards() is called.

  2. Verify that StabilityPool.sol does not invoke it.

  3. Confirm that no RAAC rewards are minted.

Impact

The intended reward mechanism for incentivizing users is broken. This could reduce user engagement, affect protocol stability, and lead to dissatisfaction among participants expecting rewards.

Tools Used

Manual

Recommendations

Ensure that StabilityPool.sol properly calls mintRewards() at the appropriate time. A suggested approach is:

  1. Identify the Reward Distribution Trigger:

    • Determine the event that should trigger rewards (e.g., liquidations or user participation in the stability pool).

  2. Call mintRewards() from StabilityPool.sol:

    lendingPool.mintRewards(user, rewardAmount);
    • Add this call in a relevant function where rewards should be minted.

Updates

Lead Judging Commences

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

RAACMinter::mintRewards function is never called by StabilityPool despite being the only authorized caller, leaving intended reward functionality unused

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

RAACMinter::mintRewards function is never called by StabilityPool despite being the only authorized caller, leaving intended reward functionality unused

Support

FAQs

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