Core Contracts

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

Incorrect Parameter passed to _distributeToGauges()

Summary

When GaugeController::distributeRevenueis called, there is a misallocation of funds to gauges.

Vulnerability Details

GaugeController::distributeRevenueis designed to distribute revenue between veToken holders and gauges. It does this by first calculating veRAACShareand performanceShare. Further down the line, the function makes a call to _distributeToGauges which should distribute rewards to gauges , but the argument it is called with is veRAACShareand not the correct performanceSharevalue.

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/gauges/GaugeController.sol#L521

As we can see in the event emitted, performanceShare is what should be distributedToGauges:

/**
* @notice Emitted when revenue is distributed to gauges
* @param gaugeType Type of the gauge
* @param amount Total amount distributed
* @param veRAACShare Amount distributed to veRAACToken holders
* @param performanceShare Amount distributed to gauges
*/
event RevenueDistributed(
GaugeType indexed gaugeType,
uint256 amount,
uint256 veRAACShare,
uint256 performanceShare
);

which means the function incorrectly sends veRAACShare to gauges instead of performanceShare

Impact

Incorrect Revenue distribution.

Tools Used

Manual Review

Recommendations

The function can be implemented correctly, like so:

function distributeRevenue(
GaugeType gaugeType,
uint256 amount
) external onlyRole(EMERGENCY_ADMIN) whenNotPaused {
if (amount == 0) revert InvalidAmount();
uint256 veRAACShare = amount * 80 / 100; // 80% to veRAAC holders
uint256 performanceShare = amount * 20 / 100; // 20% performance fee
revenueShares[gaugeType] += veRAACShare;
- _distributeToGauges(gaugeType, veRAACShare);
+ _distributeToGauges(gaugeType, performanceShare);
emit RevenueDistributed(gaugeType, amount, veRAACShare, performanceShare);
}
Updates

Lead Judging Commences

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

GaugeController.distributeRevenue calculates 20% performance fee but never transfers or allocates it to any recipient, causing loss of funds

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

GaugeController.distributeRevenue calculates 20% performance fee but never transfers or allocates it to any recipient, causing loss of funds

Support

FAQs

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