@skalenetwork/upgrade-tools 3.0.0-merge → 3.0.0-openzeppelin-5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hardhat.config.d.ts +3 -3
- package/dist/hardhat.config.js +6 -4
- package/dist/hardhat.config.js.map +1 -0
- package/dist/src/abi.d.ts +2 -2
- package/dist/src/abi.js +8 -4
- package/dist/src/abi.js.map +1 -0
- package/dist/src/contractFactory.d.ts +4 -0
- package/dist/src/contractFactory.js +84 -0
- package/dist/src/contractFactory.js.map +1 -0
- package/dist/src/deploy.d.ts +4 -4
- package/dist/src/deploy.js +59 -60
- package/dist/src/deploy.js.map +1 -0
- package/dist/src/exitCodes.d.ts +7 -0
- package/dist/src/exitCodes.js +12 -0
- package/dist/src/exitCodes.js.map +1 -0
- package/dist/src/gnosis-safe.d.ts +2 -2
- package/dist/src/gnosis-safe.js +124 -81
- package/dist/src/gnosis-safe.js.map +1 -0
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/nonceProvider.d.ts +10 -0
- package/dist/src/nonceProvider.js +34 -0
- package/dist/src/nonceProvider.js.map +1 -0
- package/dist/src/proxyAdmin.d.ts +4 -0
- package/dist/src/proxyAdmin.js +56 -0
- package/dist/src/proxyAdmin.js.map +1 -0
- package/dist/src/submitters/auto-submitter.d.ts +22 -5
- package/dist/src/submitters/auto-submitter.js +127 -118
- package/dist/src/submitters/auto-submitter.js.map +1 -0
- package/dist/src/submitters/eoa-submitter.d.ts +3 -2
- package/dist/src/submitters/eoa-submitter.js +19 -13
- package/dist/src/submitters/eoa-submitter.js.map +1 -0
- package/dist/src/submitters/index.js +1 -0
- package/dist/src/submitters/index.js.map +1 -0
- package/dist/src/submitters/safe-ima-legacy-marionette-submitter.d.ts +4 -3
- package/dist/src/submitters/safe-ima-legacy-marionette-submitter.js +14 -13
- package/dist/src/submitters/safe-ima-legacy-marionette-submitter.js.map +1 -0
- package/dist/src/submitters/safe-ima-marionette-submitter.d.ts +3 -3
- package/dist/src/submitters/safe-ima-marionette-submitter.js +13 -11
- package/dist/src/submitters/safe-ima-marionette-submitter.js.map +1 -0
- package/dist/src/submitters/safe-submitter.d.ts +4 -4
- package/dist/src/submitters/safe-submitter.js +4 -3
- package/dist/src/submitters/safe-submitter.js.map +1 -0
- package/dist/src/submitters/safe-to-ima-submitter.d.ts +11 -6
- package/dist/src/submitters/safe-to-ima-submitter.js +23 -15
- package/dist/src/submitters/safe-to-ima-submitter.js.map +1 -0
- package/dist/src/submitters/submitter.d.ts +3 -3
- package/dist/src/submitters/submitter.js +11 -7
- package/dist/src/submitters/submitter.js.map +1 -0
- package/dist/src/submitters/types/marionette.d.ts +6 -3
- package/dist/src/submitters/types/marionette.js +1 -0
- package/dist/src/submitters/types/marionette.js.map +1 -0
- package/dist/src/types/SkaleManifestData.js +1 -0
- package/dist/src/types/SkaleManifestData.js.map +1 -0
- package/dist/src/types/upgrader.d.ts +12 -0
- package/dist/src/types/upgrader.js +3 -0
- package/dist/src/types/upgrader.js.map +1 -0
- package/dist/src/upgrader.d.ts +25 -12
- package/dist/src/upgrader.js +145 -95
- package/dist/src/upgrader.js.map +1 -0
- package/dist/src/verification.d.ts +2 -2
- package/dist/src/verification.js +53 -28
- package/dist/src/verification.js.map +1 -0
- package/dist/src/version.js +11 -6
- package/dist/src/version.js.map +1 -0
- package/dist/typechain-types/AdminUpgradeabilityProxy.d.ts +59 -54
- package/dist/typechain-types/AdminUpgradeabilityProxy.js +1 -0
- package/dist/typechain-types/AdminUpgradeabilityProxy.js.map +1 -0
- package/dist/typechain-types/ProxyAdmin.d.ts +94 -137
- package/dist/typechain-types/ProxyAdmin.js +1 -0
- package/dist/typechain-types/ProxyAdmin.js.map +1 -0
- package/dist/typechain-types/common.d.ts +40 -11
- package/dist/typechain-types/common.js +1 -0
- package/dist/typechain-types/common.js.map +1 -0
- package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.d.ts +71 -41
- package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.js +8 -11
- package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.js.map +1 -0
- package/dist/typechain-types/factories/ProxyAdmin__factory.d.ts +129 -41
- package/dist/typechain-types/factories/ProxyAdmin__factory.js +8 -11
- package/dist/typechain-types/factories/ProxyAdmin__factory.js.map +1 -0
- package/dist/typechain-types/factories/index.d.ts +2 -0
- package/dist/typechain-types/factories/index.js +11 -0
- package/dist/typechain-types/factories/index.js.map +1 -0
- package/dist/typechain-types/index.d.ts +1 -0
- package/dist/typechain-types/index.js +26 -1
- package/dist/typechain-types/index.js.map +1 -0
- package/package.json +16 -15
- package/dist/src/multiSend.d.ts +0 -2
- package/dist/src/multiSend.js +0 -46
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UnsignedTransaction } from "ethers";
|
|
2
1
|
import { Submitter } from "./submitter";
|
|
2
|
+
import { Transaction } from "ethers";
|
|
3
3
|
export declare class SafeSubmitter extends Submitter {
|
|
4
4
|
safeAddress: string;
|
|
5
|
-
chainId:
|
|
6
|
-
constructor(safeAddress: string, chainId?:
|
|
7
|
-
submit(transactions:
|
|
5
|
+
chainId: bigint | undefined;
|
|
6
|
+
constructor(safeAddress: string, chainId?: bigint);
|
|
7
|
+
submit(transactions: Transaction[]): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SafeSubmitter = void 0;
|
|
4
|
-
const hardhat_1 = require("hardhat");
|
|
5
|
-
const gnosis_safe_1 = require("../gnosis-safe");
|
|
6
4
|
const submitter_1 = require("./submitter");
|
|
5
|
+
const gnosis_safe_1 = require("../gnosis-safe");
|
|
6
|
+
const hardhat_1 = require("hardhat");
|
|
7
7
|
class SafeSubmitter extends submitter_1.Submitter {
|
|
8
8
|
constructor(safeAddress, chainId) {
|
|
9
9
|
super();
|
|
@@ -14,7 +14,8 @@ class SafeSubmitter extends submitter_1.Submitter {
|
|
|
14
14
|
if (!this.chainId) {
|
|
15
15
|
this.chainId = (await hardhat_1.ethers.provider.getNetwork()).chainId;
|
|
16
16
|
}
|
|
17
|
-
await (0, gnosis_safe_1.createMultiSendTransaction)(this.safeAddress, transactions);
|
|
17
|
+
await (0, gnosis_safe_1.createMultiSendTransaction)(this.safeAddress, this.chainId, transactions);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.SafeSubmitter = SafeSubmitter;
|
|
21
|
+
//# sourceMappingURL=safe-submitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-submitter.js","sourceRoot":"","sources":["../../../src/submitters/safe-submitter.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC,gDAA0D;AAC1D,qCAA+B;AAG/B,MAAa,aAAc,SAAQ,qBAAS;IAKxC,YAAa,WAAmB,EAAE,OAAgB;QAC9C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,YAA2B;QACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,gBAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC;SAC/D;QACD,MAAM,IAAA,wCAA0B,EAC5B,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,OAAO,EACZ,YAAY,CACf,CAAC;IACN,CAAC;CACJ;AArBD,sCAqBC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { BytesLike,
|
|
1
|
+
import { BytesLike, Transaction } from "ethers";
|
|
2
|
+
import { Instance } from "@skalenetwork/skale-contracts-ethers-v6";
|
|
2
3
|
import { SafeSubmitter } from "./safe-submitter";
|
|
3
|
-
|
|
4
|
+
interface Network {
|
|
5
|
+
targetSchainHash: BytesLike;
|
|
6
|
+
mainnetChainId?: bigint;
|
|
7
|
+
}
|
|
4
8
|
export declare class SafeToImaSubmitter extends SafeSubmitter {
|
|
5
9
|
imaInstance: Instance;
|
|
6
10
|
targetSchainHash: BytesLike;
|
|
7
|
-
private
|
|
8
|
-
constructor(safeAddress: string, imaInstance: Instance,
|
|
9
|
-
submit(transactions:
|
|
10
|
-
private
|
|
11
|
+
private messageProxyForMainnet;
|
|
12
|
+
constructor(safeAddress: string, imaInstance: Instance, network: Network);
|
|
13
|
+
submit(transactions: Transaction[]): Promise<void>;
|
|
14
|
+
private getMessageProxyForMainnet;
|
|
11
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SafeToImaSubmitter = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
4
5
|
const safe_submitter_1 = require("./safe-submitter");
|
|
5
6
|
class SafeToImaSubmitter extends safe_submitter_1.SafeSubmitter {
|
|
6
|
-
constructor(safeAddress, imaInstance,
|
|
7
|
-
super(safeAddress,
|
|
7
|
+
constructor(safeAddress, imaInstance, network) {
|
|
8
|
+
super(safeAddress, network.mainnetChainId);
|
|
8
9
|
this.imaInstance = imaInstance;
|
|
9
|
-
this.targetSchainHash = targetSchainHash;
|
|
10
|
+
this.targetSchainHash = network.targetSchainHash;
|
|
10
11
|
}
|
|
11
12
|
async submit(transactions) {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const singleTransaction = 1;
|
|
14
|
+
if (transactions.length > singleTransaction) {
|
|
15
|
+
SafeToImaSubmitter.atomicityWarning();
|
|
14
16
|
}
|
|
15
|
-
const messageProxyForMainnet = await this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const messageProxyForMainnet = await this.getMessageProxyForMainnet();
|
|
18
|
+
const messageProxyForMainnetAddress = await messageProxyForMainnet.getAddress();
|
|
19
|
+
const transactionsToIma = transactions.map((transaction) => ethers_1.Transaction.from({
|
|
20
|
+
"data": messageProxyForMainnet.interface.encodeFunctionData("postOutgoingMessage", [
|
|
21
|
+
this.targetSchainHash,
|
|
22
|
+
transaction.to,
|
|
23
|
+
transaction.data
|
|
24
|
+
]),
|
|
25
|
+
"to": messageProxyForMainnetAddress
|
|
26
|
+
}));
|
|
21
27
|
await super.submit(transactionsToIma);
|
|
22
28
|
}
|
|
23
|
-
async
|
|
24
|
-
if (this.
|
|
25
|
-
this.
|
|
29
|
+
async getMessageProxyForMainnet() {
|
|
30
|
+
if (typeof this.messageProxyForMainnet === "undefined") {
|
|
31
|
+
this.messageProxyForMainnet =
|
|
32
|
+
await this.imaInstance.getContract("MessageProxyForMainnet");
|
|
26
33
|
}
|
|
27
|
-
return this.
|
|
34
|
+
return this.messageProxyForMainnet;
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
exports.SafeToImaSubmitter = SafeToImaSubmitter;
|
|
38
|
+
//# sourceMappingURL=safe-to-ima-submitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-to-ima-submitter.js","sourceRoot":"","sources":["../../../src/submitters/safe-to-ima-submitter.ts"],"names":[],"mappings":";;;AAAA,mCAA4D;AAE5D,qDAA+C;AAQ/C,MAAa,kBAAmB,SAAQ,8BAAa;IAOjD,YACI,WAAmB,EACnB,WAAqB,EACrB,OAAgB;QAEhB,KAAK,CACD,WAAW,EACX,OAAO,CAAC,cAAc,CACzB,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,YAA2B;QACrC,MAAM,iBAAiB,GAAG,CAAC,CAAC;QAC5B,IAAI,YAAY,CAAC,MAAM,GAAG,iBAAiB,EAAE;YACzC,kBAAkB,CAAC,gBAAgB,EAAE,CAAC;SACzC;QACD,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACtE,MAAM,6BAA6B,GAAG,MAAM,sBAAsB,CAAC,UAAU,EAAE,CAAC;QAChF,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,oBAAW,CAAC,IAAI,CAAC;YACzE,MAAM,EAAE,sBAAsB,CAAC,SAAS,CAAC,kBAAkB,CACvD,qBAAqB,EACrB;gBACI,IAAI,CAAC,gBAAgB;gBACrB,WAAW,CAAC,EAAE;gBACd,WAAW,CAAC,IAAI;aACnB,CACJ;YACD,IAAI,EAAE,6BAA6B;SACtC,CAAC,CAAC,CAAC;QACJ,MAAM,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,yBAAyB;QACnC,IAAI,OAAO,IAAI,CAAC,sBAAsB,KAAK,WAAW,EAAE;YACpD,IAAI,CAAC,sBAAsB;gBACvB,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;SACpE;QACD,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;CACJ;AAhDD,gDAgDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Transaction } from "ethers";
|
|
2
2
|
export declare abstract class Submitter {
|
|
3
|
-
abstract submit(transactions:
|
|
4
|
-
|
|
3
|
+
abstract submit(transactions: Transaction[]): Promise<void>;
|
|
4
|
+
protected static atomicityWarning(): void;
|
|
5
5
|
}
|
|
@@ -4,18 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Submitter = void 0;
|
|
7
|
+
const exitCodes_1 = require("../exitCodes");
|
|
7
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
9
|
class Submitter {
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
console.log(chalk_1.default.
|
|
13
|
-
console.log(chalk_1.default.red("If not atomic upgrade is OK set ALLOW_NOT_ATOMIC_UPGRADE environment variable"));
|
|
14
|
-
process.exit(1);
|
|
10
|
+
// Protected
|
|
11
|
+
static atomicityWarning() {
|
|
12
|
+
if (process.env.ALLOW_NOT_ATOMIC_UPGRADE) {
|
|
13
|
+
console.log(chalk_1.default.yellow("Not atomic upgrade is performing"));
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
|
-
console.log(chalk_1.default.
|
|
16
|
+
console.log(chalk_1.default.red("The upgrade will consist" +
|
|
17
|
+
" of multiple transactions and will not be atomic"));
|
|
18
|
+
console.log(chalk_1.default.red("If not atomic upgrade is OK" +
|
|
19
|
+
" set ALLOW_NOT_ATOMIC_UPGRADE environment variable"));
|
|
20
|
+
process.exit(exitCodes_1.EXIT_CODES.NOT_ATOMIC_UPGRADE);
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
exports.Submitter = Submitter;
|
|
25
|
+
//# sourceMappingURL=submitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitter.js","sourceRoot":"","sources":["../../../src/submitters/submitter.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAwC;AAExC,kDAA0B;AAG1B,MAAsB,SAAS;IAG3B,YAAY;IAEF,MAAM,CAAC,gBAAgB;QAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE;YACtC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC;SACjE;aAAM;YACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B;gBAC5C,kDAAkD,CAAC,CAAC,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,6BAA6B;gBAC/C,oDAAoD,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,sBAAU,CAAC,kBAAkB,CAAC,CAAC;SAC/C;IACL,CAAC;CACJ;AAhBD,8BAgBC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { BigNumberish, BytesLike } from "ethers";
|
|
2
|
-
import { ethers as RawEthers } from "ethers";
|
|
1
|
+
import { BigNumberish, BytesLike, ethers as RawEthers } from "ethers";
|
|
3
2
|
export declare const MARIONETTE_ADDRESS = "0xD2c0DeFACe000000000000000000000000000000";
|
|
4
3
|
type FunctionCallStruct = {
|
|
5
4
|
receiver: string;
|
|
6
5
|
value: BigNumberish;
|
|
7
6
|
data: BytesLike;
|
|
8
7
|
};
|
|
9
|
-
export interface
|
|
8
|
+
export interface LegacyMarionette extends RawEthers.BaseContract {
|
|
9
|
+
encodeFunctionCall(receiver: string, value: BigNumberish, data: BytesLike): Promise<BytesLike>;
|
|
10
|
+
version(): Promise<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface Marionette extends RawEthers.BaseContract {
|
|
10
13
|
encodeFunctionCalls(functionCalls: FunctionCallStruct[]): Promise<BytesLike>;
|
|
11
14
|
version(): Promise<string>;
|
|
12
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marionette.js","sourceRoot":"","sources":["../../../../src/submitters/types/marionette.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAG,4CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkaleManifestData.js","sourceRoot":"","sources":["../../../src/types/SkaleManifestData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Instance } from "@skalenetwork/skale-contracts-ethers-v6";
|
|
2
|
+
export interface ContractToUpgrade {
|
|
3
|
+
proxyAddress: string;
|
|
4
|
+
implementationAddress: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Project {
|
|
8
|
+
name: string;
|
|
9
|
+
instance: Instance;
|
|
10
|
+
version: string;
|
|
11
|
+
contractNamesToUpgrade: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../../src/types/upgrader.ts"],"names":[],"mappings":""}
|
package/dist/src/upgrader.d.ts
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Project } from "./types/upgrader";
|
|
2
2
|
import { Submitter } from "./submitters/submitter";
|
|
3
|
-
import { Instance } from "@skalenetwork/skale-contracts-ethers-v5";
|
|
4
3
|
export declare abstract class Upgrader {
|
|
5
|
-
instance
|
|
6
|
-
targetVersion
|
|
7
|
-
contractNamesToUpgrade
|
|
8
|
-
projectName
|
|
9
|
-
transactions
|
|
10
|
-
submitter
|
|
11
|
-
|
|
4
|
+
private instance;
|
|
5
|
+
private targetVersion;
|
|
6
|
+
private contractNamesToUpgrade;
|
|
7
|
+
private projectName;
|
|
8
|
+
private transactions;
|
|
9
|
+
private submitter;
|
|
10
|
+
private nonceProvider?;
|
|
11
|
+
private deploySemaphore;
|
|
12
|
+
constructor(project: Project, submitter?: Submitter);
|
|
12
13
|
abstract getDeployedVersion: () => Promise<string | undefined>;
|
|
13
14
|
abstract setVersion: (newVersion: string) => Promise<void>;
|
|
14
|
-
deployNewContracts
|
|
15
|
-
initialize
|
|
15
|
+
deployNewContracts?: () => Promise<void>;
|
|
16
|
+
initialize?: () => Promise<void>;
|
|
16
17
|
upgrade(): Promise<void>;
|
|
17
|
-
|
|
18
|
+
getOwner(): Promise<string>;
|
|
19
|
+
private callInitialize;
|
|
20
|
+
private callDeployNewContracts;
|
|
21
|
+
private prepareVersion;
|
|
22
|
+
private writeTransactions;
|
|
23
|
+
private static verify;
|
|
24
|
+
private switchToNewImplementations;
|
|
25
|
+
private deployNewImplementations;
|
|
26
|
+
private protectedDeployNewImplementation;
|
|
27
|
+
private deployNewImplementation;
|
|
28
|
+
private prepareUpgrade;
|
|
29
|
+
private getNormalizedDeployedVersion;
|
|
30
|
+
private checkVersion;
|
|
18
31
|
}
|
package/dist/src/upgrader.js
CHANGED
|
@@ -4,126 +4,176 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Upgrader = void 0;
|
|
7
|
-
const hardhat_1 =
|
|
7
|
+
const hardhat_1 = require("hardhat");
|
|
8
|
+
const proxyAdmin_1 = require("./proxyAdmin");
|
|
9
|
+
const auto_submitter_1 = require("./submitters/auto-submitter");
|
|
10
|
+
const exitCodes_1 = require("./exitCodes");
|
|
11
|
+
const nonceProvider_1 = require("./nonceProvider");
|
|
12
|
+
const semaphore_async_await_1 = __importDefault(require("semaphore-async-await"));
|
|
8
13
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const hardhat_2 = require("hardhat");
|
|
10
|
-
const admin_1 = require("@openzeppelin/hardhat-upgrades/dist/admin");
|
|
11
|
-
const version_1 = require("./version");
|
|
12
14
|
const fs_1 = require("fs");
|
|
13
|
-
const
|
|
15
|
+
const contractFactory_1 = require("./contractFactory");
|
|
14
16
|
const upgrades_core_1 = require("@openzeppelin/upgrades-core");
|
|
17
|
+
const version_1 = require("./version");
|
|
15
18
|
const verification_1 = require("./verification");
|
|
16
|
-
const
|
|
19
|
+
const withoutNull = (array) => array.
|
|
20
|
+
filter((element) => element !== null);
|
|
21
|
+
// TODO: Set to 8 when upgrade plugins become thread safe
|
|
22
|
+
const maxSimultaneousDeployments = 1;
|
|
23
|
+
// 10 minutes
|
|
24
|
+
const deployTimeout = 60e4;
|
|
17
25
|
class Upgrader {
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.targetVersion = targetVersion;
|
|
23
|
-
if (!targetVersion.includes('-')) {
|
|
24
|
-
this.targetVersion = targetVersion + '-stable.0';
|
|
26
|
+
constructor(project, submitter) {
|
|
27
|
+
this.targetVersion = project.version;
|
|
28
|
+
if (!project.version.includes("-")) {
|
|
29
|
+
this.targetVersion = `${project.version}-stable.0`;
|
|
25
30
|
}
|
|
26
|
-
this.instance = instance;
|
|
27
|
-
this.contractNamesToUpgrade = contractNamesToUpgrade;
|
|
28
|
-
this.projectName =
|
|
31
|
+
this.instance = project.instance;
|
|
32
|
+
this.contractNamesToUpgrade = project.contractNamesToUpgrade;
|
|
33
|
+
this.projectName = project.name;
|
|
29
34
|
this.transactions = [];
|
|
30
|
-
this.submitter = submitter;
|
|
35
|
+
this.submitter = submitter ?? new auto_submitter_1.AutoSubmitter(this);
|
|
36
|
+
this.deploySemaphore = new semaphore_async_await_1.default(maxSimultaneousDeployments);
|
|
31
37
|
}
|
|
32
|
-
//
|
|
38
|
+
// Public
|
|
33
39
|
async upgrade() {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const version = await this.prepareVersion();
|
|
41
|
+
await this.callDeployNewContracts();
|
|
42
|
+
const contractsToUpgrade = await this.deployNewImplementations();
|
|
43
|
+
await this.switchToNewImplementations(contractsToUpgrade);
|
|
44
|
+
await this.callInitialize();
|
|
45
|
+
// Write version
|
|
46
|
+
await this.setVersion(version);
|
|
47
|
+
await this.writeTransactions(version);
|
|
48
|
+
await this.submitter.submit(this.transactions);
|
|
49
|
+
await Upgrader.verify(contractsToUpgrade);
|
|
50
|
+
console.log("Done");
|
|
51
|
+
}
|
|
52
|
+
async getOwner() {
|
|
53
|
+
const proxyAddresses = await Promise.all(this.contractNamesToUpgrade.map((contract) => this.instance.getContractAddress(contract), this));
|
|
54
|
+
const admins = await Promise.all(proxyAddresses.map((proxy) => (0, proxyAdmin_1.getProxyAdmin)(proxy)));
|
|
55
|
+
const owners = await Promise.all(admins.map((admin) => admin.owner()));
|
|
56
|
+
return owners.reduce((owner1, owner2) => {
|
|
57
|
+
if (owner1 !== owner2) {
|
|
58
|
+
throw Error("Proxies have different owners");
|
|
44
59
|
}
|
|
60
|
+
return owner1;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Private
|
|
64
|
+
async callInitialize() {
|
|
65
|
+
if (typeof this.initialize !== "undefined") {
|
|
66
|
+
await this.initialize();
|
|
45
67
|
}
|
|
46
|
-
|
|
47
|
-
|
|
68
|
+
}
|
|
69
|
+
async callDeployNewContracts() {
|
|
70
|
+
if (typeof this.deployNewContracts !== "undefined") {
|
|
71
|
+
// Deploy new contracts
|
|
72
|
+
await this.deployNewContracts();
|
|
48
73
|
}
|
|
74
|
+
}
|
|
75
|
+
async prepareVersion() {
|
|
76
|
+
const version = await (0, version_1.getVersion)();
|
|
77
|
+
await this.checkVersion(version);
|
|
49
78
|
console.log(`Will mark updated version as ${version}`);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const currentImplementationAddress = await (0, upgrades_core_1.getImplementationAddress)(hardhat_2.network.provider, proxyAddress), newImplementationAddress = await hardhat_2.upgrades.prepareUpgrade(proxyAddress, contractFactory, {
|
|
58
|
-
unsafeAllowLinkedLibraries: true,
|
|
59
|
-
unsafeAllowRenames: true
|
|
60
|
-
});
|
|
61
|
-
if (newImplementationAddress !== currentImplementationAddress) {
|
|
62
|
-
contractsToUpgrade.push({
|
|
63
|
-
proxyAddress,
|
|
64
|
-
implementationAddress: newImplementationAddress,
|
|
65
|
-
name: contract
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
console.log(chalk_1.default.gray(`Contract ${contract} is up to date`));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Switch proxies to new implementations
|
|
73
|
-
for (const contract of contractsToUpgrade) {
|
|
74
|
-
console.log(chalk_1.default.yellowBright(`Prepare transaction to upgrade ${contract.name} at ${contract.proxyAddress} to ${contract.implementationAddress}`));
|
|
75
|
-
this.transactions.push({
|
|
76
|
-
to: proxyAdmin.address,
|
|
77
|
-
data: proxyAdmin.interface.encodeFunctionData("upgrade", [contract.proxyAddress, contract.implementationAddress])
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
await this.initialize();
|
|
81
|
-
// write version
|
|
82
|
-
await this.setVersion(version);
|
|
83
|
-
await fs_1.promises.writeFile(`data/transactions-${version}-${hardhat_2.network.name}.json`, JSON.stringify(this.transactions, null, 4));
|
|
84
|
-
await this.submitter.submit(this.transactions);
|
|
79
|
+
return version;
|
|
80
|
+
}
|
|
81
|
+
async writeTransactions(version) {
|
|
82
|
+
const indentation = 4;
|
|
83
|
+
await fs_1.promises.writeFile(`data/transactions-${version}-${hardhat_1.network.name}.json`, JSON.stringify(this.transactions, null, indentation));
|
|
84
|
+
}
|
|
85
|
+
static async verify(contractsToUpgrade) {
|
|
85
86
|
if (process.env.NO_VERIFY) {
|
|
86
87
|
console.log("Skip verification");
|
|
87
88
|
}
|
|
88
89
|
else {
|
|
89
90
|
console.log("Start verification");
|
|
90
|
-
|
|
91
|
-
await (0, verification_1.verify)(contract.name, contract.implementationAddress, []);
|
|
92
|
-
}
|
|
91
|
+
await Promise.all(contractsToUpgrade.map((contract) => (0, verification_1.verify)(contract.name, contract.implementationAddress, [])));
|
|
93
92
|
}
|
|
94
|
-
console.log("Done");
|
|
95
93
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
async switchToNewImplementations(contractsToUpgrade) {
|
|
95
|
+
const upgradeTransactions = await Promise.all(contractsToUpgrade.map((contract) => (0, proxyAdmin_1.getUpgradeTransaction)(contract.proxyAddress, contract.implementationAddress)));
|
|
96
|
+
contractsToUpgrade.forEach((contract, index) => {
|
|
97
|
+
const infoMessage = `Prepare transaction to upgrade ${contract.name}` +
|
|
98
|
+
` at ${contract.proxyAddress}` +
|
|
99
|
+
` to ${contract.implementationAddress}`;
|
|
100
|
+
console.log(chalk_1.default.yellowBright(infoMessage));
|
|
101
|
+
this.transactions.push(upgradeTransactions[index]);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async deployNewImplementations() {
|
|
105
|
+
const [deployer] = await hardhat_1.ethers.getSigners();
|
|
106
|
+
this.nonceProvider ?? (this.nonceProvider = await nonceProvider_1.NonceProvider.createForWallet(deployer));
|
|
107
|
+
const contracts = await Promise.all(this.contractNamesToUpgrade.
|
|
108
|
+
map(this.protectedDeployNewImplementation, this));
|
|
109
|
+
return withoutNull(contracts);
|
|
110
|
+
}
|
|
111
|
+
async protectedDeployNewImplementation(contract) {
|
|
112
|
+
await this.deploySemaphore.acquire();
|
|
113
|
+
let result = null;
|
|
114
|
+
try {
|
|
115
|
+
result = await this.deployNewImplementation(contract);
|
|
104
116
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
finally {
|
|
118
|
+
this.deploySemaphore.release();
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
async deployNewImplementation(contract) {
|
|
123
|
+
const contractFactory = await (0, contractFactory_1.getContractFactoryAndUpdateManifest)(contract, this.nonceProvider);
|
|
124
|
+
const proxyAddress = await (await this.instance.getContract(contract)).getAddress();
|
|
125
|
+
console.log(`Prepare upgrade of ${contract}`);
|
|
126
|
+
return this.prepareUpgrade(contract, proxyAddress, contractFactory);
|
|
127
|
+
}
|
|
128
|
+
async prepareUpgrade(contractName, proxyAddress, contractFactory) {
|
|
129
|
+
const currentImplementationAddress = await (0, upgrades_core_1.getImplementationAddress)(hardhat_1.network.provider, proxyAddress);
|
|
130
|
+
const nonce = this.nonceProvider?.reserveNonce();
|
|
131
|
+
const newImplementationAddress = await hardhat_1.upgrades.prepareUpgrade(proxyAddress, contractFactory, {
|
|
132
|
+
"timeout": deployTimeout,
|
|
133
|
+
"txOverrides": {
|
|
134
|
+
nonce
|
|
135
|
+
},
|
|
136
|
+
"unsafeAllowLinkedLibraries": true,
|
|
137
|
+
"unsafeAllowRenames": true
|
|
138
|
+
});
|
|
139
|
+
if (newImplementationAddress !== currentImplementationAddress) {
|
|
140
|
+
return {
|
|
141
|
+
"implementationAddress": newImplementationAddress,
|
|
142
|
+
"name": contractName,
|
|
143
|
+
proxyAddress
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
console.log(chalk_1.default.gray(`Contract ${contractName} is up to date`));
|
|
147
|
+
if (nonce) {
|
|
148
|
+
this.nonceProvider?.releaseNonce(nonce);
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
async getNormalizedDeployedVersion() {
|
|
153
|
+
const deployedVersion = await this.getDeployedVersion();
|
|
154
|
+
if (deployedVersion) {
|
|
155
|
+
if (!deployedVersion.includes("-")) {
|
|
156
|
+
return `${deployedVersion}-stable.0`;
|
|
114
157
|
}
|
|
115
|
-
|
|
116
|
-
|
|
158
|
+
return deployedVersion;
|
|
159
|
+
}
|
|
160
|
+
return deployedVersion;
|
|
161
|
+
}
|
|
162
|
+
async checkVersion(version) {
|
|
163
|
+
const deployedVersion = await this.getNormalizedDeployedVersion();
|
|
164
|
+
if (deployedVersion) {
|
|
165
|
+
if (deployedVersion !== this.targetVersion) {
|
|
166
|
+
const cannotUpgradeMessage = `This script can't upgrade version ${deployedVersion}` +
|
|
167
|
+
` to ${version}`;
|
|
168
|
+
console.log(chalk_1.default.red(cannotUpgradeMessage));
|
|
169
|
+
process.exit(exitCodes_1.EXIT_CODES.BAD_VERSION);
|
|
117
170
|
}
|
|
118
171
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
manifest.libraries[libraryName] = { "address": libraryAddress, "bytecodeHash": (0, upgrades_core_1.hashBytecode)(bytecode) };
|
|
172
|
+
else {
|
|
173
|
+
const cannotCheckMessage = `Can't check currently deployed version of ${this.projectName}`;
|
|
174
|
+
console.log(chalk_1.default.yellow(cannotCheckMessage));
|
|
123
175
|
}
|
|
124
|
-
Object.assign(libraries, oldLibraries);
|
|
125
|
-
await fs_1.promises.writeFile(await (0, deploy_1.getManifestFile)(), JSON.stringify(manifest, null, 4));
|
|
126
|
-
return await (0, deploy_1.getLinkedContractFactory)(contract, libraries);
|
|
127
176
|
}
|
|
128
177
|
}
|
|
129
178
|
exports.Upgrader = Upgrader;
|
|
179
|
+
//# sourceMappingURL=upgrader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":";;;;;;AAEA,qCAAkD;AAClD,6CAAkE;AAClE,gEAA0D;AAC1D,2CAAuC;AAEvC,mDAA8C;AAC9C,kFAA8C;AAE9C,kDAA0B;AAC1B,2BAAkC;AAClC,uDAAsE;AACtE,+DAAqE;AACrE,uCAAqC;AACrC,iDAAsC;AAGtC,MAAM,WAAW,GAAG,CAAI,KAAsB,EAAE,EAAE,CAAC,KAAK;IACpD,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,CAAa,CAAC;AAEtD,yDAAyD;AACzD,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,gCAAgC;AAChC,MAAM,aAAa,GAAG,IAAI,CAAC;AAG3B,MAAsB,QAAQ;IAU1B,YACI,OAAgB,EAChB,SAAqB;QAErB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAChC,IAAI,CAAC,aAAa,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,CAAC,eAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC7C,OAAO,CAAC,IAAI,CAAC,sBAAU,CAAC,WAAW,CAAC,CAAC;aACxC;SACJ;aAAM;YACH,MAAM,kBAAkB,GACpB,6CAA6C,IAAI,CAAC,WAAW,EAAE,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;SACjD;IACL,CAAC;CACJ;AAhPD,4BAgPC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare
|
|
1
|
+
export declare const verify: (contractName: string, contractAddress: string, constructorArguments: object) => Promise<void>;
|
|
2
|
+
export declare const verifyProxy: (contractName: string, proxyAddress: string, constructorArguments: object) => Promise<void>;
|