@skalenetwork/upgrade-tools 3.0.0-merge → 3.0.0-proxy-admin.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.
Files changed (87) hide show
  1. package/dist/hardhat.config.d.ts +3 -3
  2. package/dist/hardhat.config.js +6 -4
  3. package/dist/hardhat.config.js.map +1 -0
  4. package/dist/src/abi.d.ts +2 -2
  5. package/dist/src/abi.js +8 -4
  6. package/dist/src/abi.js.map +1 -0
  7. package/dist/src/contractFactory.d.ts +4 -0
  8. package/dist/src/contractFactory.js +84 -0
  9. package/dist/src/contractFactory.js.map +1 -0
  10. package/dist/src/deploy.d.ts +4 -4
  11. package/dist/src/deploy.js +59 -60
  12. package/dist/src/deploy.js.map +1 -0
  13. package/dist/src/exitCodes.d.ts +7 -0
  14. package/dist/src/exitCodes.js +12 -0
  15. package/dist/src/exitCodes.js.map +1 -0
  16. package/dist/src/gnosis-safe.d.ts +2 -2
  17. package/dist/src/gnosis-safe.js +125 -81
  18. package/dist/src/gnosis-safe.js.map +1 -0
  19. package/dist/src/index.d.ts +0 -1
  20. package/dist/src/index.js +1 -1
  21. package/dist/src/index.js.map +1 -0
  22. package/dist/src/nonceProvider.d.ts +10 -0
  23. package/dist/src/nonceProvider.js +34 -0
  24. package/dist/src/nonceProvider.js.map +1 -0
  25. package/dist/src/submitters/auto-submitter.d.ts +19 -5
  26. package/dist/src/submitters/auto-submitter.js +128 -118
  27. package/dist/src/submitters/auto-submitter.js.map +1 -0
  28. package/dist/src/submitters/eoa-submitter.d.ts +3 -2
  29. package/dist/src/submitters/eoa-submitter.js +19 -13
  30. package/dist/src/submitters/eoa-submitter.js.map +1 -0
  31. package/dist/src/submitters/index.js +1 -0
  32. package/dist/src/submitters/index.js.map +1 -0
  33. package/dist/src/submitters/safe-ima-legacy-marionette-submitter.d.ts +4 -3
  34. package/dist/src/submitters/safe-ima-legacy-marionette-submitter.js +14 -13
  35. package/dist/src/submitters/safe-ima-legacy-marionette-submitter.js.map +1 -0
  36. package/dist/src/submitters/safe-ima-marionette-submitter.d.ts +3 -3
  37. package/dist/src/submitters/safe-ima-marionette-submitter.js +13 -11
  38. package/dist/src/submitters/safe-ima-marionette-submitter.js.map +1 -0
  39. package/dist/src/submitters/safe-submitter.d.ts +4 -4
  40. package/dist/src/submitters/safe-submitter.js +3 -2
  41. package/dist/src/submitters/safe-submitter.js.map +1 -0
  42. package/dist/src/submitters/safe-to-ima-submitter.d.ts +11 -6
  43. package/dist/src/submitters/safe-to-ima-submitter.js +23 -15
  44. package/dist/src/submitters/safe-to-ima-submitter.js.map +1 -0
  45. package/dist/src/submitters/submitter.d.ts +3 -3
  46. package/dist/src/submitters/submitter.js +11 -7
  47. package/dist/src/submitters/submitter.js.map +1 -0
  48. package/dist/src/submitters/types/marionette.d.ts +6 -3
  49. package/dist/src/submitters/types/marionette.js +1 -0
  50. package/dist/src/submitters/types/marionette.js.map +1 -0
  51. package/dist/src/types/SkaleManifestData.js +1 -0
  52. package/dist/src/types/SkaleManifestData.js.map +1 -0
  53. package/dist/src/types/upgrader.d.ts +12 -0
  54. package/dist/src/types/upgrader.js +3 -0
  55. package/dist/src/types/upgrader.js.map +1 -0
  56. package/dist/src/upgrader.d.ts +26 -7
  57. package/dist/src/upgrader.js +175 -96
  58. package/dist/src/upgrader.js.map +1 -0
  59. package/dist/src/verification.d.ts +2 -2
  60. package/dist/src/verification.js +53 -28
  61. package/dist/src/verification.js.map +1 -0
  62. package/dist/src/version.js +11 -6
  63. package/dist/src/version.js.map +1 -0
  64. package/dist/typechain-types/AdminUpgradeabilityProxy.d.ts +59 -54
  65. package/dist/typechain-types/AdminUpgradeabilityProxy.js +1 -0
  66. package/dist/typechain-types/AdminUpgradeabilityProxy.js.map +1 -0
  67. package/dist/typechain-types/ProxyAdmin.d.ts +94 -137
  68. package/dist/typechain-types/ProxyAdmin.js +1 -0
  69. package/dist/typechain-types/ProxyAdmin.js.map +1 -0
  70. package/dist/typechain-types/common.d.ts +40 -11
  71. package/dist/typechain-types/common.js +1 -0
  72. package/dist/typechain-types/common.js.map +1 -0
  73. package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.d.ts +71 -41
  74. package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.js +8 -11
  75. package/dist/typechain-types/factories/AdminUpgradeabilityProxy__factory.js.map +1 -0
  76. package/dist/typechain-types/factories/ProxyAdmin__factory.d.ts +129 -41
  77. package/dist/typechain-types/factories/ProxyAdmin__factory.js +8 -11
  78. package/dist/typechain-types/factories/ProxyAdmin__factory.js.map +1 -0
  79. package/dist/typechain-types/factories/index.d.ts +2 -0
  80. package/dist/typechain-types/factories/index.js +11 -0
  81. package/dist/typechain-types/factories/index.js.map +1 -0
  82. package/dist/typechain-types/index.d.ts +1 -0
  83. package/dist/typechain-types/index.js +26 -1
  84. package/dist/typechain-types/index.js.map +1 -0
  85. package/package.json +15 -14
  86. package/dist/src/multiSend.d.ts +0 -2
  87. package/dist/src/multiSend.js +0 -46
@@ -1,11 +1,16 @@
1
- import { BytesLike, UnsignedTransaction } from "ethers";
1
+ import { BytesLike, Transaction } from "ethers";
2
+ import { Instance } from "@skalenetwork/skale-contracts-ethers-v6";
2
3
  import { SafeSubmitter } from "./safe-submitter";
3
- import { Instance } from "@skalenetwork/skale-contracts-ethers-v5";
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 _messageProxyForMainnet;
8
- constructor(safeAddress: string, imaInstance: Instance, targetSchainHash: BytesLike, chainId?: number);
9
- submit(transactions: UnsignedTransaction[]): Promise<void>;
10
- private _getMessageProxyForMainnet;
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, targetSchainHash, chainId) {
7
- super(safeAddress, chainId);
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
- if (transactions.length > 1) {
13
- this._atomicityWarning();
13
+ const singleTransaction = 1;
14
+ if (transactions.length > singleTransaction) {
15
+ SafeToImaSubmitter.atomicityWarning();
14
16
  }
15
- const messageProxyForMainnet = await this._getMessageProxyForMainnet(), transactionsToIma = transactions.map((transaction) => {
16
- return {
17
- to: messageProxyForMainnet.address,
18
- data: messageProxyForMainnet.interface.encodeFunctionData("postOutgoingMessage", [this.targetSchainHash, transaction.to, transaction.data])
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 _getMessageProxyForMainnet() {
24
- if (this._messageProxyForMainnet === undefined) {
25
- this._messageProxyForMainnet = await this.imaInstance.getContract("MessageProxyForMainnet");
29
+ async getMessageProxyForMainnet() {
30
+ if (typeof this.messageProxyForMainnet === "undefined") {
31
+ this.messageProxyForMainnet =
32
+ await this.imaInstance.getContract("MessageProxyForMainnet");
26
33
  }
27
- return this._messageProxyForMainnet;
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 { UnsignedTransaction } from "ethers";
1
+ import { Transaction } from "ethers";
2
2
  export declare abstract class Submitter {
3
- abstract submit(transactions: UnsignedTransaction[]): Promise<void>;
4
- _atomicityWarning(): void;
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
- // private
10
- _atomicityWarning() {
11
- if (!process.env.ALLOW_NOT_ATOMIC_UPGRADE) {
12
- console.log(chalk_1.default.red("The upgrade will consist of multiple transactions and will not be atomic"));
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.yellow("Not atomic upgrade is performing"));
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 Marionette extends RawEthers.Contract {
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
  }
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MARIONETTE_ADDRESS = void 0;
4
4
  exports.MARIONETTE_ADDRESS = "0xD2c0DeFACe000000000000000000000000000000";
5
+ //# sourceMappingURL=marionette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marionette.js","sourceRoot":"","sources":["../../../../src/submitters/types/marionette.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAG,4CAA4C,CAAC"}
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SkaleManifestData.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=upgrader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../../src/types/upgrader.ts"],"names":[],"mappings":""}
@@ -1,18 +1,37 @@
1
- import { UnsignedTransaction } from "ethers";
1
+ import { Transaction } from "ethers";
2
+ import { Project } from "./types/upgrader";
3
+ import { Instance } from "@skalenetwork/skale-contracts-ethers-v6";
4
+ import { NonceProvider } from "./nonceProvider";
5
+ import { ProxyAdmin } from "../typechain-types";
6
+ import Semaphore from 'semaphore-async-await';
2
7
  import { Submitter } from "./submitters/submitter";
3
- import { Instance } from "@skalenetwork/skale-contracts-ethers-v5";
4
8
  export declare abstract class Upgrader {
5
9
  instance: Instance;
6
10
  targetVersion: string;
7
11
  contractNamesToUpgrade: string[];
8
12
  projectName: string;
9
- transactions: UnsignedTransaction[];
13
+ transactions: Transaction[];
10
14
  submitter: Submitter;
11
- constructor(projectName: string, targetVersion: string, instance: Instance, contractNamesToUpgrade: string[], submitter?: Submitter);
15
+ nonceProvider?: NonceProvider;
16
+ deploySemaphore: Semaphore;
17
+ constructor(project: Project, submitter?: Submitter);
12
18
  abstract getDeployedVersion: () => Promise<string | undefined>;
13
19
  abstract setVersion: (newVersion: string) => Promise<void>;
14
- deployNewContracts: () => Promise<void>;
15
- initialize: () => Promise<void>;
20
+ deployNewContracts?: () => Promise<void>;
21
+ initialize?: () => Promise<void>;
16
22
  upgrade(): Promise<void>;
17
- _getContractFactoryAndUpdateManifest(contract: string): Promise<import("ethers").ContractFactory>;
23
+ static getProxyAdmin(): Promise<ProxyAdmin>;
24
+ private callInitialize;
25
+ private callDeployNewContracts;
26
+ private prepareVersion;
27
+ private writeTransactions;
28
+ private static verify;
29
+ private switchToNewImplementations;
30
+ private deployNewImplementations;
31
+ private protectedDeployNewImplementation;
32
+ private deployNewImplementation;
33
+ private prepareUpgrade;
34
+ private getNormalizedDeployedVersion;
35
+ private checkVersion;
36
+ private static isNewProxyAdmin;
18
37
  }
@@ -4,126 +4,205 @@ 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 = __importDefault(require("hardhat"));
7
+ const ethers_1 = require("ethers");
8
+ const upgrades_core_1 = require("@openzeppelin/upgrades-core");
9
+ const hardhat_1 = require("hardhat");
10
+ const auto_submitter_1 = require("./submitters/auto-submitter");
11
+ const exitCodes_1 = require("./exitCodes");
12
+ const nonceProvider_1 = require("./nonceProvider");
13
+ const semaphore_async_await_1 = __importDefault(require("semaphore-async-await"));
8
14
  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
15
  const fs_1 = require("fs");
13
- const deploy_1 = require("./deploy");
14
- const upgrades_core_1 = require("@openzeppelin/upgrades-core");
16
+ const contractFactory_1 = require("./contractFactory");
17
+ const version_1 = require("./version");
15
18
  const verification_1 = require("./verification");
16
- const auto_submitter_1 = require("./submitters/auto-submitter");
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(projectName, targetVersion, instance, contractNamesToUpgrade, submitter = new auto_submitter_1.AutoSubmitter()) {
19
- // protected
20
- this.deployNewContracts = () => { return Promise.resolve(); };
21
- this.initialize = () => { return Promise.resolve(); };
22
- this.targetVersion = targetVersion;
23
- if (!targetVersion.includes('-')) {
24
- this.targetVersion = targetVersion + '-stable.0';
25
- }
26
- this.instance = instance;
27
- this.contractNamesToUpgrade = contractNamesToUpgrade;
28
- this.projectName = projectName;
26
+ constructor(project, submitter = new auto_submitter_1.AutoSubmitter()) {
27
+ this.targetVersion = project.version;
28
+ if (!project.version.includes("-")) {
29
+ this.targetVersion = `${project.version}-stable.0`;
30
+ }
31
+ this.instance = project.instance;
32
+ this.contractNamesToUpgrade = project.contractNamesToUpgrade;
33
+ this.projectName = project.name;
29
34
  this.transactions = [];
30
35
  this.submitter = submitter;
36
+ this.deploySemaphore = new semaphore_async_await_1.default(maxSimultaneousDeployments);
31
37
  }
32
- // public
38
+ // Public
33
39
  async upgrade() {
34
- const proxyAdmin = await (0, admin_1.getManifestAdmin)(hardhat_1.default);
35
- let deployedVersion = await this.getDeployedVersion();
40
+ const version = await this.prepareVersion();
41
+ await this.callDeployNewContracts();
42
+ const contractsToUpgrade = await this.deployNewImplementations();
43
+ await this.switchToNewImplementations(contractsToUpgrade, await Upgrader.getProxyAdmin());
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
+ static async getProxyAdmin() {
53
+ const manifest = await upgrades_core_1.Manifest.forNetwork(hardhat_1.network.provider);
54
+ const adminDeployment = await manifest.getAdmin();
55
+ if (!adminDeployment) {
56
+ throw new Error("Can't load ProxyAdmin address");
57
+ }
58
+ const factory = await hardhat_1.ethers.getContractFactory("ProxyAdmin");
59
+ return factory.attach(adminDeployment.address);
60
+ }
61
+ // Private
62
+ async callInitialize() {
63
+ if (typeof this.initialize !== "undefined") {
64
+ await this.initialize();
65
+ }
66
+ }
67
+ async callDeployNewContracts() {
68
+ if (typeof this.deployNewContracts !== "undefined") {
69
+ // Deploy new contracts
70
+ await this.deployNewContracts();
71
+ }
72
+ }
73
+ async prepareVersion() {
36
74
  const version = await (0, version_1.getVersion)();
37
- if (deployedVersion) {
38
- if (!deployedVersion.includes('-')) {
39
- deployedVersion = deployedVersion + '-stable.0';
40
- }
41
- if (deployedVersion !== this.targetVersion) {
42
- console.log(chalk_1.default.red(`This script can't upgrade version ${deployedVersion} to ${version}`));
43
- process.exit(1);
44
- }
75
+ await this.checkVersion(version);
76
+ console.log(`Will mark updated version as ${version}`);
77
+ return version;
78
+ }
79
+ async writeTransactions(version) {
80
+ const indentation = 4;
81
+ await fs_1.promises.writeFile(`data/transactions-${version}-${hardhat_1.network.name}.json`, JSON.stringify(this.transactions, null, indentation));
82
+ }
83
+ static async verify(contractsToUpgrade) {
84
+ if (process.env.NO_VERIFY) {
85
+ console.log("Skip verification");
45
86
  }
46
87
  else {
47
- console.log(chalk_1.default.yellow(`Can't check currently deployed version of ${this.projectName}`));
88
+ console.log("Start verification");
89
+ await Promise.all(contractsToUpgrade.map((contract) => (0, verification_1.verify)(contract.name, contract.implementationAddress, [])));
48
90
  }
49
- console.log(`Will mark updated version as ${version}`);
50
- // Deploy new contracts
51
- await this.deployNewContracts();
52
- // Deploy new implementations
53
- const contractsToUpgrade = [];
54
- for (const contract of this.contractNamesToUpgrade) {
55
- const contractFactory = await this._getContractFactoryAndUpdateManifest(contract), proxyAddress = (await this.instance.getContract(contract)).address;
56
- console.log(`Prepare upgrade of ${contract}`);
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
91
+ }
92
+ async switchToNewImplementations(contractsToUpgrade, proxyAdmin) {
93
+ const proxyAdminAddress = await proxyAdmin.getAddress();
94
+ const newProxyAdmin = await Upgrader.isNewProxyAdmin(proxyAdminAddress);
95
+ for (const contract of contractsToUpgrade) {
96
+ const infoMessage = `Prepare transaction to upgrade ${contract.name}` +
97
+ ` at ${contract.proxyAddress}` +
98
+ ` to ${contract.implementationAddress}`;
99
+ console.log(chalk_1.default.yellowBright(infoMessage));
100
+ let transaction = ethers_1.Transaction.from({
101
+ "data": proxyAdmin.interface.encodeFunctionData("upgradeAndCall", [
102
+ contract.proxyAddress,
103
+ contract.implementationAddress,
104
+ ""
105
+ ]),
106
+ "to": proxyAdminAddress
60
107
  });
61
- if (newImplementationAddress !== currentImplementationAddress) {
62
- contractsToUpgrade.push({
63
- proxyAddress,
64
- implementationAddress: newImplementationAddress,
65
- name: contract
108
+ if (!newProxyAdmin) {
109
+ transaction = ethers_1.Transaction.from({
110
+ "data": proxyAdmin.interface.encodeFunctionData("upgrade", [
111
+ contract.proxyAddress,
112
+ contract.implementationAddress
113
+ ]),
114
+ "to": proxyAdminAddress
66
115
  });
67
116
  }
68
- else {
69
- console.log(chalk_1.default.gray(`Contract ${contract} is up to date`));
70
- }
117
+ this.transactions.push(transaction);
71
118
  }
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
- });
119
+ }
120
+ async deployNewImplementations() {
121
+ const [deployer] = await hardhat_1.ethers.getSigners();
122
+ this.nonceProvider ?? (this.nonceProvider = await nonceProvider_1.NonceProvider.createForWallet(deployer));
123
+ const contracts = await Promise.all(this.contractNamesToUpgrade.
124
+ map(this.protectedDeployNewImplementation, this));
125
+ return withoutNull(contracts);
126
+ }
127
+ async protectedDeployNewImplementation(contract) {
128
+ await this.deploySemaphore.acquire();
129
+ let result = null;
130
+ try {
131
+ result = await this.deployNewImplementation(contract);
79
132
  }
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);
85
- if (process.env.NO_VERIFY) {
86
- console.log("Skip verification");
133
+ finally {
134
+ this.deploySemaphore.release();
87
135
  }
88
- else {
89
- console.log("Start verification");
90
- for (const contract of contractsToUpgrade) {
91
- await (0, verification_1.verify)(contract.name, contract.implementationAddress, []);
92
- }
136
+ return result;
137
+ }
138
+ async deployNewImplementation(contract) {
139
+ const contractFactory = await (0, contractFactory_1.getContractFactoryAndUpdateManifest)(contract, this.nonceProvider);
140
+ const proxyAddress = await (await this.instance.getContract(contract)).getAddress();
141
+ console.log(`Prepare upgrade of ${contract}`);
142
+ return this.prepareUpgrade(contract, proxyAddress, contractFactory);
143
+ }
144
+ async prepareUpgrade(contractName, proxyAddress, contractFactory) {
145
+ const currentImplementationAddress = await (0, upgrades_core_1.getImplementationAddress)(hardhat_1.network.provider, proxyAddress);
146
+ const nonce = this.nonceProvider?.reserveNonce();
147
+ const newImplementationAddress = await hardhat_1.upgrades.prepareUpgrade(proxyAddress, contractFactory, {
148
+ "timeout": deployTimeout,
149
+ "txOverrides": {
150
+ nonce
151
+ },
152
+ "unsafeAllowLinkedLibraries": true,
153
+ "unsafeAllowRenames": true
154
+ });
155
+ if (newImplementationAddress !== currentImplementationAddress) {
156
+ return {
157
+ "implementationAddress": newImplementationAddress,
158
+ "name": contractName,
159
+ proxyAddress
160
+ };
93
161
  }
94
- console.log("Done");
162
+ console.log(chalk_1.default.gray(`Contract ${contractName} is up to date`));
163
+ if (nonce) {
164
+ this.nonceProvider?.releaseNonce(nonce);
165
+ }
166
+ return null;
95
167
  }
96
- // private
97
- async _getContractFactoryAndUpdateManifest(contract) {
98
- const { linkReferences } = await hardhat_2.artifacts.readArtifact(contract), manifest = JSON.parse(await fs_1.promises.readFile(await (0, deploy_1.getManifestFile)(), "utf-8"));
99
- if (!Object.keys(linkReferences).length)
100
- return await hardhat_2.ethers.getContractFactory(contract);
101
- const librariesToUpgrade = [], oldLibraries = {};
102
- if (manifest.libraries === undefined) {
103
- Object.assign(manifest, { libraries: {} });
104
- }
105
- for (const key of Object.keys(linkReferences)) {
106
- const libraryName = Object.keys(linkReferences[key])[0], { bytecode } = await hardhat_2.artifacts.readArtifact(libraryName);
107
- if (manifest.libraries[libraryName] === undefined) {
108
- librariesToUpgrade.push(libraryName);
109
- continue;
110
- }
111
- const libraryBytecodeHash = manifest.libraries[libraryName].bytecodeHash;
112
- if ((0, upgrades_core_1.hashBytecode)(bytecode) !== libraryBytecodeHash) {
113
- librariesToUpgrade.push(libraryName);
168
+ async getNormalizedDeployedVersion() {
169
+ const deployedVersion = await this.getDeployedVersion();
170
+ if (deployedVersion) {
171
+ if (!deployedVersion.includes("-")) {
172
+ return `${deployedVersion}-stable.0`;
114
173
  }
115
- else {
116
- oldLibraries[libraryName] = manifest.libraries[libraryName].address;
174
+ return deployedVersion;
175
+ }
176
+ return deployedVersion;
177
+ }
178
+ async checkVersion(version) {
179
+ const deployedVersion = await this.getNormalizedDeployedVersion();
180
+ if (deployedVersion) {
181
+ if (deployedVersion !== this.targetVersion) {
182
+ const cannotUpgradeMessage = `This script can't upgrade version ${deployedVersion}` +
183
+ ` to ${version}`;
184
+ console.log(chalk_1.default.red(cannotUpgradeMessage));
185
+ process.exit(exitCodes_1.EXIT_CODES.BAD_VERSION);
117
186
  }
118
187
  }
119
- const libraries = await (0, deploy_1.deployLibraries)(librariesToUpgrade);
120
- for (const [libraryName, libraryAddress] of libraries.entries()) {
121
- const { bytecode } = await hardhat_2.artifacts.readArtifact(libraryName);
122
- manifest.libraries[libraryName] = { "address": libraryAddress, "bytecodeHash": (0, upgrades_core_1.hashBytecode)(bytecode) };
188
+ else {
189
+ const cannotCheckMessage = `Can't check currently deployed version of ${this.projectName}`;
190
+ console.log(chalk_1.default.yellow(cannotCheckMessage));
191
+ }
192
+ }
193
+ static async isNewProxyAdmin(proxyAdminAddress) {
194
+ const interfaceVersionAbi = ["function UPGRADE_INTERFACE_VERSION()"];
195
+ const proxyAdminContract = new hardhat_1.ethers.Contract(proxyAdminAddress, interfaceVersionAbi);
196
+ try {
197
+ // This function name is set in external library
198
+ // eslint-disable-next-line new-cap
199
+ await proxyAdminContract.UPGRADE_INTERFACE_VERSION();
200
+ return true;
201
+ }
202
+ catch {
203
+ return false;
123
204
  }
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
205
  }
128
206
  }
129
207
  exports.Upgrader = Upgrader;
208
+ //# sourceMappingURL=upgrader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrader.js","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAoD;AAEpD,+DAA+E;AAC/E,qCAAkD;AAClD,gEAA0D;AAC1D,2CAAuC;AAEvC,mDAA8C;AAE9C,kFAA8C;AAE9C,kDAA0B;AAC1B,2BAAkC;AAClC,uDAAsE;AACt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CAAC;CACJ;AA7QD,4BA6QC"}
@@ -1,2 +1,2 @@
1
- export declare function verify(contractName: string, contractAddress: string, constructorArguments: object): Promise<void>;
2
- export declare function verifyProxy(contractName: string, proxyAddress: string, constructorArguments: object): Promise<void>;
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>;