Skip to content

Commit 4846f0c

Browse files
committed
fix: prepared SortitionModule upgrade adding changeGovernor()
1 parent c76e4af commit 4846f0c

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

contracts/deploy/upgrade-sortition-module.ts contracts/deploy/upgrade-sortition-module-v0.9.0.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeE
1515
console.log("upgrading SortitionModuleNeo...");
1616
await deployUpgradable(deployments, "SortitionModuleNeo", {
1717
newImplementation: "SortitionModuleNeo",
18-
initializer: "initialize",
18+
initializer: "initialize3",
1919
from: deployer,
2020
// Warning: do not reinitialize everything, only the new variables
2121
args: [],

contracts/src/arbitration/SortitionModule.sol

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ contract SortitionModule is SortitionModuleBase {
4444
__SortitionModuleBase_initialize(_governor, _core, _minStakingTime, _maxDrawingTime, _rng, _rngLookahead);
4545
}
4646

47+
function initialize3() external reinitializer(3) {
48+
// NOP
49+
}
50+
4751
// ************************************* //
4852
// * Governance * //
4953
// ************************************* //

contracts/src/arbitration/SortitionModuleBase.sol

+6
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ abstract contract SortitionModuleBase is ISortitionModule, Initializable, UUPSPr
152152
// * Governance * //
153153
// ************************************* //
154154

155+
/// @dev Changes the governor of the contract.
156+
/// @param _governor The new governor.
157+
function changeGovernor(address _governor) external onlyByGovernor {
158+
governor = _governor;
159+
}
160+
155161
/// @dev Changes the `minStakingTime` storage variable.
156162
/// @param _minStakingTime The new value for the `minStakingTime` storage variable.
157163
function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {

contracts/src/arbitration/SortitionModuleNeo.sol

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ contract SortitionModuleNeo is SortitionModuleBase {
5858
maxTotalStaked = _maxTotalStaked;
5959
}
6060

61+
function initialize3() external reinitializer(3) {
62+
// NOP
63+
}
64+
6165
// ************************************* //
6266
// * Governance * //
6367
// ************************************* //

0 commit comments

Comments
 (0)