Skip to content

Commit 030eedf

Browse files
committed
feat: reset of the proxies version and initializers ahead of the migration
1 parent 98f7eac commit 030eedf

21 files changed

+38
-90
lines changed

contracts/deploy/upgrade-all.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
9898
await upgrade(disputeKitShutter, "reinitialize", [wETH.address]);
9999
await upgrade(disputeKitGated, "reinitialize", [wETH.address]);
100100
await upgrade(disputeKitGatedShutter, "reinitialize", [wETH.address]);
101-
await upgrade(disputeTemplateRegistry, "initialize2", []);
102-
await upgrade(evidence, "initialize2", []);
101+
await upgrade(disputeTemplateRegistry, "reinitialize", []);
102+
await upgrade(evidence, "reinitialize", []);
103103
await upgrade(core, "reinitialize", [wETH.address]);
104-
await upgrade(policyRegistry, "initialize2", []);
105-
await upgrade(sortition, "initialize4", []);
104+
await upgrade(policyRegistry, "reinitialize", []);
105+
await upgrade(sortition, "reinitialize", []);
106106
};
107107

108108
deployUpgradeAll.tags = ["UpgradeAll"];

contracts/src/arbitration/DisputeTemplateRegistry.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "./interfaces/IDisputeTemplateRegistry.sol";
88
/// @title Dispute Template Registry
99
/// @dev A contract to maintain a registry of dispute templates.
1010
contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {
11-
string public constant override version = "0.8.0";
11+
string public constant override version = "2.0.0";
1212

1313
// ************************************* //
1414
// * Storage * //
@@ -40,14 +40,10 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
4040

4141
/// @dev Initializer
4242
/// @param _owner Owner of the contract.
43-
function initialize(address _owner) external reinitializer(1) {
43+
function initialize(address _owner) external initializer {
4444
owner = _owner;
4545
}
4646

47-
function initialize2() external reinitializer(2) {
48-
// NOP
49-
}
50-
5147
// ************************ //
5248
// * Governance * //
5349
// ************************ //

contracts/src/arbitration/KlerosCore.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {KlerosCoreBase, IDisputeKit, ISortitionModule, IERC20} from "./KlerosCor
88
/// Core arbitrator contract for Kleros v2.
99
/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.
1010
contract KlerosCore is KlerosCoreBase {
11-
string public constant override version = "0.10.0";
11+
string public constant override version = "2.0.0";
1212

1313
// ************************************* //
1414
// * Constructor * //
@@ -43,7 +43,7 @@ contract KlerosCore is KlerosCoreBase {
4343
bytes memory _sortitionExtraData,
4444
ISortitionModule _sortitionModuleAddress,
4545
address _wNative
46-
) external reinitializer(1) {
46+
) external initializer {
4747
__KlerosCoreBase_initialize(
4848
_owner,
4949
_guardian,
@@ -59,10 +59,6 @@ contract KlerosCore is KlerosCoreBase {
5959
);
6060
}
6161

62-
function reinitialize(address _wNative) external reinitializer(6) {
63-
wNative = _wNative;
64-
}
65-
6662
// ************************************* //
6763
// * Governance * //
6864
// ************************************* //

contracts/src/arbitration/KlerosCoreNeo.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
99
/// Core arbitrator contract for Kleros v2.
1010
/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.
1111
contract KlerosCoreNeo is KlerosCoreBase {
12-
string public constant override version = "0.10.0";
12+
string public constant override version = "2.0.0";
1313

1414
// ************************************* //
1515
// * Storage * //
@@ -70,10 +70,6 @@ contract KlerosCoreNeo is KlerosCoreBase {
7070
jurorNft = _jurorNft;
7171
}
7272

73-
function reinitialize(address _wNative) external reinitializer(6) {
74-
wNative = _wNative;
75-
}
76-
7773
// ************************************* //
7874
// * Governance * //
7975
// ************************************* //

contracts/src/arbitration/PolicyRegistry.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "../proxy/Initializable.sol";
77
/// @title PolicyRegistry
88
/// @dev A contract to maintain a policy for each court.
99
contract PolicyRegistry is UUPSProxiable, Initializable {
10-
string public constant override version = "0.8.0";
10+
string public constant override version = "2.0.0";
1111

1212
// ************************************* //
1313
// * Events * //
@@ -47,14 +47,10 @@ contract PolicyRegistry is UUPSProxiable, Initializable {
4747

4848
/// @dev Constructs the `PolicyRegistry` contract.
4949
/// @param _owner The owner's address.
50-
function initialize(address _owner) external reinitializer(1) {
50+
function initialize(address _owner) external initializer {
5151
owner = _owner;
5252
}
5353

54-
function initialize2() external reinitializer(2) {
55-
// NOP
56-
}
57-
5854
// ************************************* //
5955
// * Governance * //
6056
// ************************************* //

contracts/src/arbitration/SortitionModule.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {SortitionModuleBase, KlerosCore, IRNG} from "./SortitionModuleBase.sol";
77
/// @title SortitionModule
88
/// @dev A factory of trees that keeps track of staked values for sortition.
99
contract SortitionModule is SortitionModuleBase {
10-
string public constant override version = "0.9.0";
10+
string public constant override version = "2.0.0";
1111

1212
// ************************************* //
1313
// * Constructor * //
@@ -30,14 +30,10 @@ contract SortitionModule is SortitionModuleBase {
3030
uint256 _minStakingTime,
3131
uint256 _maxDrawingTime,
3232
IRNG _rng
33-
) external reinitializer(1) {
33+
) external initializer {
3434
__SortitionModuleBase_initialize(_owner, _core, _minStakingTime, _maxDrawingTime, _rng);
3535
}
3636

37-
function initialize4() external reinitializer(4) {
38-
// NOP
39-
}
40-
4137
// ************************************* //
4238
// * Governance * //
4339
// ************************************* //

contracts/src/arbitration/SortitionModuleNeo.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {SortitionModuleBase, KlerosCore, IRNG, StakingResult} from "./SortitionM
77
/// @title SortitionModuleNeo
88
/// @dev A factory of trees that keeps track of staked values for sortition.
99
contract SortitionModuleNeo is SortitionModuleBase {
10-
string public constant override version = "0.9.0";
10+
string public constant override version = "2.0.0";
1111

1212
// ************************************* //
1313
// * Storage * //
@@ -48,10 +48,6 @@ contract SortitionModuleNeo is SortitionModuleBase {
4848
maxTotalStaked = _maxTotalStaked;
4949
}
5050

51-
function initialize4() external reinitializer(4) {
52-
// NOP
53-
}
54-
5551
// ************************************* //
5652
// * Governance * //
5753
// ************************************* //

contracts/src/arbitration/devtools/KlerosCoreRuler.sol

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "../../libraries/Constants.sol";
1313
contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
1414
using SafeERC20 for IERC20;
1515

16-
string public constant override version = "0.8.0";
16+
string public constant override version = "2.0.0";
1717

1818
// ************************************* //
1919
// * Enums / Structs * //
@@ -175,11 +175,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
175175
/// @param _owner The owner's address.
176176
/// @param _pinakion The address of the token contract.
177177
/// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).
178-
function initialize(
179-
address _owner,
180-
IERC20 _pinakion,
181-
uint256[4] memory _courtParameters
182-
) external reinitializer(1) {
178+
function initialize(address _owner, IERC20 _pinakion, uint256[4] memory _courtParameters) external initializer {
183179
owner = _owner;
184180
pinakion = _pinakion;
185181

@@ -210,10 +206,6 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
210206
);
211207
}
212208

213-
function initialize2() external reinitializer(2) {
214-
// NOP
215-
}
216-
217209
// ************************************* //
218210
// * Governance * //
219211
// ************************************* //

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {DisputeKitClassicBase, KlerosCore} from "./DisputeKitClassicBase.sol";
1111
/// - an incentive system: equal split between coherent votes,
1212
/// - an appeal system: fund 2 choices only, vote on any choice.
1313
contract DisputeKitClassic is DisputeKitClassicBase {
14-
string public constant override version = "0.13.0";
14+
string public constant override version = "2.0.0";
1515

1616
// ************************************* //
1717
// * Constructor * //
@@ -32,14 +32,10 @@ contract DisputeKitClassic is DisputeKitClassicBase {
3232
KlerosCore _core,
3333
address _wNative,
3434
uint256 _jumpDisputeKitID
35-
) external reinitializer(1) {
35+
) external initializer {
3636
__DisputeKitClassicBase_initialize(_owner, _core, _wNative, _jumpDisputeKitID);
3737
}
3838

39-
function reinitialize(uint256 _jumpDisputeKitID) external reinitializer(10) {
40-
jumpDisputeKitID = _jumpDisputeKitID;
41-
}
42-
4339
// ************************ //
4440
// * Governance * //
4541
// ************************ //

contracts/src/arbitration/dispute-kits/DisputeKitGated.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface IBalanceHolderERC1155 {
2727
/// - an incentive system: equal split between coherent votes,
2828
/// - an appeal system: fund 2 choices only, vote on any choice.
2929
contract DisputeKitGated is DisputeKitClassicBase {
30-
string public constant override version = "0.13.0";
30+
string public constant override version = "2.0.0";
3131

3232
// ************************************* //
3333
// * Constructor * //
@@ -48,14 +48,10 @@ contract DisputeKitGated is DisputeKitClassicBase {
4848
KlerosCore _core,
4949
address _wNative,
5050
uint256 _jumpDisputeKitID
51-
) external reinitializer(1) {
51+
) external initializer {
5252
__DisputeKitClassicBase_initialize(_owner, _core, _wNative, _jumpDisputeKitID);
5353
}
5454

55-
function reinitialize(uint256 _jumpDisputeKitID) external reinitializer(10) {
56-
jumpDisputeKitID = _jumpDisputeKitID;
57-
}
58-
5955
// ************************ //
6056
// * Governance * //
6157
// ************************ //

0 commit comments

Comments
 (0)