Skip to content

Commit ce82e0b

Browse files
committed
chore: upgrade scripts preparation
1 parent 701c14e commit ce82e0b

File tree

9 files changed

+28
-31
lines changed

9 files changed

+28
-31
lines changed

contracts/deploy/upgrade-all.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment)
9292
}
9393
};
9494

95-
await upgrade(disputeKitClassic, "initialize7", []);
96-
await upgrade(disputeKitShutter, "initialize8", []);
97-
await upgrade(disputeKitGated, "initialize7", []);
98-
await upgrade(disputeKitGatedShutter, "initialize7", []);
95+
const wETH = await deployments.get("WETH");
96+
97+
await upgrade(disputeKitClassic, "reinitialize", [wETH.address]);
98+
await upgrade(disputeKitShutter, "reinitialize", [wETH.address]);
99+
await upgrade(disputeKitGated, "reinitialize", [wETH.address]);
100+
await upgrade(disputeKitGatedShutter, "reinitialize", [wETH.address]);
99101
await upgrade(disputeTemplateRegistry, "initialize2", []);
100102
await upgrade(evidence, "initialize2", []);
101-
await upgrade(core, "initialize5", []);
103+
await upgrade(core, "reinitialize", [wETH.address]);
102104
await upgrade(policyRegistry, "initialize2", []);
103105
await upgrade(sortition, "initialize4", []);
104106
};

contracts/scripts/storage-layout.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
44
task("storage-layout", "Prints the storage layout of a contract").setAction(
55
async ({}, hre: HardhatRuntimeEnvironment) => {
66
await hre.run("compile");
7-
const buildInfo = await hre.artifacts.getBuildInfo(
8-
`src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic`
9-
);
10-
console.log(
11-
buildInfo.output.contracts["src/arbitration/dispute-kits/DisputeKitClassic.sol"]["DisputeKitClassic"]
12-
.storageLayout
13-
);
7+
const buildInfo = await hre.artifacts.getBuildInfo(`src/arbitration/KlerosCoreNeo.sol:KlerosCoreNeo`);
8+
console.log(buildInfo.output.contracts["src/arbitration/KlerosCoreNeo.sol"]["KlerosCoreNeo"].storageLayout);
149
}
1510
);

contracts/src/arbitration/KlerosCore.sol

Lines changed: 3 additions & 3 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.9.4";
11+
string public constant override version = "0.10.0";
1212

1313
// ************************************* //
1414
// * Constructor * //
@@ -59,8 +59,8 @@ contract KlerosCore is KlerosCoreBase {
5959
);
6060
}
6161

62-
function initialize5() external reinitializer(5) {
63-
// NOP
62+
function reinitialize(address _wNative) external reinitializer(6) {
63+
wNative = _wNative;
6464
}
6565

6666
// ************************************* //

contracts/src/arbitration/KlerosCoreNeo.sol

Lines changed: 3 additions & 3 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.9.4";
12+
string public constant override version = "0.10.0";
1313

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

73-
function initialize5() external reinitializer(5) {
74-
// NOP
73+
function reinitialize(address _wNative) external reinitializer(6) {
74+
wNative = _wNative;
7575
}
7676

7777
// ************************************* //

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

Lines changed: 3 additions & 3 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.11.0";
14+
string public constant override version = "0.12.0";
1515

1616
// ************************************* //
1717
// * Constructor * //
@@ -30,8 +30,8 @@ contract DisputeKitClassic is DisputeKitClassicBase {
3030
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
3131
}
3232

33-
function initialize7() external reinitializer(7) {
34-
// NOP
33+
function reinitialize(address _wNative) external reinitializer(9) {
34+
wNative = _wNative;
3535
}
3636

3737
// ************************ //

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

Lines changed: 3 additions & 3 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.11.0";
30+
string public constant override version = "0.12.0";
3131

3232
// ************************************* //
3333
// * Constructor * //
@@ -46,8 +46,8 @@ contract DisputeKitGated is DisputeKitClassicBase {
4646
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
4747
}
4848

49-
function initialize7() external reinitializer(7) {
50-
// NOP
49+
function reinitialize(address _wNative) external reinitializer(9) {
50+
wNative = _wNative;
5151
}
5252

5353
// ************************ //

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface IBalanceHolderERC1155 {
2828
/// - an incentive system: equal split between coherent votes,
2929
/// - an appeal system: fund 2 choices only, vote on any choice.
3030
contract DisputeKitGatedShutter is DisputeKitClassicBase {
31-
string public constant override version = "0.11.0";
31+
string public constant override version = "0.12.0";
3232

3333
// ************************************* //
3434
// * Events * //
@@ -65,8 +65,8 @@ contract DisputeKitGatedShutter is DisputeKitClassicBase {
6565
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
6666
}
6767

68-
function initialize7() external reinitializer(7) {
69-
// NOP
68+
function reinitialize(address _wNative) external reinitializer(9) {
69+
wNative = _wNative;
7070
}
7171

7272
// ************************ //

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {DisputeKitClassicBase, KlerosCore} from "./DisputeKitClassicBase.sol";
1212
/// - an incentive system: equal split between coherent votes,
1313
/// - an appeal system: fund 2 choices only, vote on any choice.
1414
contract DisputeKitShutter is DisputeKitClassicBase {
15-
string public constant override version = "0.11.1";
15+
string public constant override version = "0.12.0";
1616

1717
// ************************************* //
1818
// * Events * //
@@ -49,8 +49,8 @@ contract DisputeKitShutter is DisputeKitClassicBase {
4949
__DisputeKitClassicBase_initialize(_governor, _core, _wNative);
5050
}
5151

52-
function initialize8() external reinitializer(8) {
53-
// NOP
52+
function reinitialize(address _wNative) external reinitializer(9) {
53+
wNative = _wNative;
5454
}
5555

5656
// ************************ //

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface IProofOfHumanity {
1818
/// - an incentive system: equal split between coherent votes,
1919
/// - an appeal system: fund 2 choices only, vote on any choice.
2020
contract DisputeKitSybilResistant is DisputeKitClassicBase {
21-
string public constant override version = "0.10.0";
21+
string public constant override version = "0.12.0";
2222

2323
// ************************************* //
2424
// * Storage * //

0 commit comments

Comments
 (0)