@skalenetwork/upgrade-tools 2.0.0-refactor.0 → 2.0.0-refactor.1

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.
@@ -1,6 +1,6 @@
1
1
  import { UnsignedTransaction } from "ethers";
2
- import { SkaleABIFile } from "../types/SkaleABIFile";
3
- import { Submitter } from "../submitters/Submitter";
2
+ import { SkaleABIFile } from "./types/SkaleABIFile";
3
+ import { Submitter } from "./submitters/Submitter";
4
4
  export declare abstract class Upgrader {
5
5
  abi: SkaleABIFile;
6
6
  targetVersion: string;
@@ -17,13 +17,13 @@ const hardhat_1 = __importDefault(require("hardhat"));
17
17
  const chalk_1 = __importDefault(require("chalk"));
18
18
  const hardhat_2 = require("hardhat");
19
19
  const admin_1 = require("@openzeppelin/hardhat-upgrades/dist/admin");
20
- const version_1 = require("../version");
20
+ const version_1 = require("./version");
21
21
  const fs_1 = require("fs");
22
- const deploy_1 = require("../deploy");
22
+ const deploy_1 = require("./deploy");
23
23
  const upgrades_core_1 = require("@openzeppelin/upgrades-core");
24
- const abi_1 = require("../abi");
25
- const verification_1 = require("../verification");
26
- const AutoSubmitter_1 = require("../submitters/AutoSubmitter");
24
+ const abi_1 = require("./abi");
25
+ const verification_1 = require("./verification");
26
+ const AutoSubmitter_1 = require("./submitters/AutoSubmitter");
27
27
  class Upgrader {
28
28
  constructor(projectName, targetVersion, abi, contractNamesToUpgrade, submitter = new AutoSubmitter_1.AutoSubmitter()) {
29
29
  this.targetVersion = targetVersion;
@@ -70,13 +70,7 @@ const URLS = {
70
70
  };
71
71
  // public functions
72
72
  function getSafeTransactionUrl(chainId) {
73
- if (chainId === Network.MAINNET) {
74
- return URLS.safe_transaction[chainId];
75
- }
76
- else if (chainId === Network.RINKEBY) {
77
- return URLS.safe_transaction[chainId];
78
- }
79
- else if (chainId === Network.GOERLI) {
73
+ if (Object.keys(URLS.safe_transaction).includes(chainId.toString())) {
80
74
  return URLS.safe_transaction[chainId];
81
75
  }
82
76
  else {
@@ -85,10 +79,7 @@ function getSafeTransactionUrl(chainId) {
85
79
  }
86
80
  exports.getSafeTransactionUrl = getSafeTransactionUrl;
87
81
  function getSafeRelayUrl(chainId) {
88
- if (chainId === 1) {
89
- return URLS.safe_relay[chainId];
90
- }
91
- else if (chainId === 4) {
82
+ if (Object.keys(URLS.safe_relay).includes(chainId.toString())) {
92
83
  return URLS.safe_relay[chainId];
93
84
  }
94
85
  else {
@@ -196,18 +187,12 @@ function sendSafeTransaction(safe, chainId, safeTx) {
196
187
  exports.sendSafeTransaction = sendSafeTransaction;
197
188
  // private functions
198
189
  function getMultiSendAddress(chainId) {
199
- if (chainId === Network.MAINNET) {
200
- return ADDRESSES.multiSend[chainId];
201
- }
202
- else if (chainId === Network.RINKEBY) {
203
- return ADDRESSES.multiSend[chainId];
190
+ if ([Network.GANACHE, Network.HARDHAT].includes(chainId)) {
191
+ return ethers_1.ethers.constants.AddressZero;
204
192
  }
205
- else if (chainId === Network.GOERLI) {
193
+ else if (Object.keys(ADDRESSES.multiSend).includes(chainId.toString())) {
206
194
  return ADDRESSES.multiSend[chainId];
207
195
  }
208
- else if ([Network.GANACHE, Network.HARDHAT].includes(chainId)) {
209
- return ethers_1.ethers.constants.AddressZero;
210
- }
211
196
  else {
212
197
  throw Error(`Can't get multiSend contract at network with chainId = ${chainId}`);
213
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalenetwork/upgrade-tools",
3
- "version": "2.0.0-refactor.0",
3
+ "version": "2.0.0-refactor.1",
4
4
  "description": "Scripts to support upgrades of smart contracts",
5
5
  "files": [
6
6
  "dist/**/*"