diff --git a/contracts/deploy/upgrade-sortition-module.ts b/contracts/deploy/upgrade-sortition-module-v0.9.0.ts similarity index 97% rename from contracts/deploy/upgrade-sortition-module.ts rename to contracts/deploy/upgrade-sortition-module-v0.9.0.ts index 86a277a1b..819c240b0 100644 --- a/contracts/deploy/upgrade-sortition-module.ts +++ b/contracts/deploy/upgrade-sortition-module-v0.9.0.ts @@ -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: [], diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 828f674c0..3c076791f 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -44,6 +44,10 @@ contract SortitionModule is SortitionModuleBase { __SortitionModuleBase_initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead); } + function initialize3() external reinitializer(3) { + // NOP + } + // ************************************* // // * Governance * // // ************************************* // diff --git a/contracts/src/arbitration/SortitionModuleBase.sol b/contracts/src/arbitration/SortitionModuleBase.sol index 651ab6bc3..edb10edf1 100644 --- a/contracts/src/arbitration/SortitionModuleBase.sol +++ b/contracts/src/arbitration/SortitionModuleBase.sol @@ -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 { diff --git a/contracts/src/arbitration/SortitionModuleNeo.sol b/contracts/src/arbitration/SortitionModuleNeo.sol index 5d725e277..2e60307d2 100644 --- a/contracts/src/arbitration/SortitionModuleNeo.sol +++ b/contracts/src/arbitration/SortitionModuleNeo.sol @@ -58,6 +58,10 @@ contract SortitionModuleNeo is SortitionModuleBase { maxTotalStaked = _maxTotalStaked; } + function initialize3() external reinitializer(3) { + // NOP + } + // ************************************* // // * Governance * // // ************************************* //