Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortitionModule upgrade to add changeGovernor() #1862

Merged
merged 1 commit into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeE
console.log("upgrading SortitionModuleNeo...");
await deployUpgradable(deployments, "SortitionModuleNeo", {
newImplementation: "SortitionModuleNeo",
initializer: "initialize",
initializer: "initialize3",
from: deployer,
// Warning: do not reinitialize everything, only the new variables
args: [],
Expand Down
4 changes: 4 additions & 0 deletions contracts/src/arbitration/SortitionModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ contract SortitionModule is SortitionModuleBase {
__SortitionModuleBase_initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead);
}

function initialize3() external reinitializer(3) {
// NOP
}

// ************************************* //
// * Governance * //
// ************************************* //
Expand Down
6 changes: 6 additions & 0 deletions contracts/src/arbitration/SortitionModuleBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ abstract contract SortitionModuleBase is ISortitionModule, Initializable, UUPSPr
// * Governance * //
// ************************************* //

/// @dev Changes the governor of the contract.
/// @param _governor The new governor.
function changeGovernor(address _governor) external onlyByGovernor {
governor = _governor;
}

/// @dev Changes the `minStakingTime` storage variable.
/// @param _minStakingTime The new value for the `minStakingTime` storage variable.
function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {
Expand Down
4 changes: 4 additions & 0 deletions contracts/src/arbitration/SortitionModuleNeo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ contract SortitionModuleNeo is SortitionModuleBase {
maxTotalStaked = _maxTotalStaked;
}

function initialize3() external reinitializer(3) {
// NOP
}

// ************************************* //
// * Governance * //
// ************************************* //
Expand Down
Loading