Core Contracts

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

updatePeriod() inside BaseGauge.sol can never be called since GaugeController makes no call to it

Description

updatePeriod() has the onlyController modifier and as can be seen in the constructor, _controller is meant to point to the cotroller contract i.e. GaugeController.sol:

/**
* @notice Initializes the gauge contract
* @param _rewardToken Address of reward token
* @param _stakingToken Address of staking token
@--> * @param _controller Address of controller contract
* @param _maxEmission Maximum emission amount
* @param _periodDuration Duration of the period
*/
constructor(
address _rewardToken,
address _stakingToken,
address _controller,
uint256 _maxEmission,
uint256 _periodDuration
) {
rewardToken = IERC20(_rewardToken);
stakingToken = IERC20(_stakingToken);
controller = _controller;
// Initialize roles
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
@--> _grantRole(CONTROLLER_ROLE, _controller);
// ... Rest of the code

However GaugeController.sol has no function which can call updatePeriod().

Impact

The current period params can't be updated in BaseGauge.sol.

Updates

Lead Judging Commences

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

GaugeController::updatePeriod doesn't call the gauge's updatePeriod function, preventing periodState.distributed from resetting and eventually causing distributeRewards to permanently fail

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

GaugeController::updatePeriod doesn't call the gauge's updatePeriod function, preventing periodState.distributed from resetting and eventually causing distributeRewards to permanently fail

Support

FAQs

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