Core Contracts

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

BaseGauge::_getBaseWeight implemented wrongly

_getBaseWeight function is a virtual function that should be overridden. In its present stage, it is wrong, as it aspires to get the weight of the account param passed, but returns the weight of the current address instead:

/**
* @notice Gets base weight for an account
* @dev Virtual function to be implemented by child contracts
* @param account Address to get weight for
* @return Base weight value
*/
function _getBaseWeight(
address account
) internal view virtual returns (uint256) {
return IGaugeController(controller).getGaugeWeight(address(this));
}

Recommendation

change address(this) into account param.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

BaseGauge._getBaseWeight ignores account parameter and returns gauge's total weight, allowing users to claim rewards from gauges they never voted for or staked in

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

BaseGauge._getBaseWeight ignores account parameter and returns gauge's total weight, allowing users to claim rewards from gauges they never voted for or staked in

Support

FAQs

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