Skip to content

Commit

Permalink
Only manager role for certain functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dulguun-staderlabs committed Jan 5, 2024
1 parent 45200fa commit 4abd088
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contracts/SDIncentiveController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,22 @@ contract SDIncentiveController is ISDIncentiveController, AccessControlUpgradeab
}

/// @notice Updates the emission rate of the reward tokens per block.
/// @dev only `MANAGER` role can call
/// @param newEmissionRate The new emission rate per block.
function updateEmissionRate(uint256 newEmissionRate) external override onlyRole(DEFAULT_ADMIN_ROLE) {
function updateEmissionRate(uint256 newEmissionRate) external override {
UtilLib.onlyManagerRole(msg.sender, staderConfig);

if (newEmissionRate == 0) revert InvalidEmissionRate();
emissionPerBlock = newEmissionRate;
emit EmissionRateUpdated(newEmissionRate);
}

/// @notice Updates the end block of the reward period.
/// @dev only `MANAGER` role can call
/// @param _newEndBlock The new end block.
function updateEndBlock(uint256 _newEndBlock) external override onlyRole(DEFAULT_ADMIN_ROLE) {
function updateEndBlock(uint256 _newEndBlock) external override {
UtilLib.onlyManagerRole(msg.sender, staderConfig);

if (_newEndBlock <= block.number) revert InvalidEndBlock();
rewardEndBlock = _newEndBlock;
emit RewardEndBlockUpdated(_newEndBlock);
Expand Down

0 comments on commit 4abd088

Please sign in to comment.