@skalenetwork/upgrade-tools 3.0.0-linter.25 → 3.0.0-linter.26

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.
@@ -6,8 +6,8 @@ require("@openzeppelin/hardhat-upgrades");
6
6
  const coreArtifacts = "node_modules/@openzeppelin/upgrades-core/artifacts/[!b]*.json";
7
7
  const config = {
8
8
  "typechain": {
9
- "target": "ethers-v5",
10
- "externalArtifacts": [coreArtifacts]
9
+ "externalArtifacts": [coreArtifacts],
10
+ "target": "ethers-v5"
11
11
  }
12
12
  };
13
13
  exports.default = config;
@@ -41,8 +41,6 @@ const URLS = {
41
41
  }
42
42
  };
43
43
  const defaultOptions = {
44
- // Max gas to use in the transaction
45
- "safeTxGas": "0",
46
44
  /*
47
45
  * Gas costs not related to the transaction execution
48
46
  * (signature check, refund payment...)
@@ -57,17 +55,19 @@ const defaultOptions = {
57
55
  */
58
56
  "gasToken": hardhat_1.ethers.constants.AddressZero,
59
57
  // Address of receiver of gas payment (or `null` if tx.origin)
60
- "refundReceiver": hardhat_1.ethers.constants.AddressZero
58
+ "refundReceiver": hardhat_1.ethers.constants.AddressZero,
59
+ // Max gas to use in the transaction
60
+ "safeTxGas": "0"
61
61
  };
62
62
  // Private functions
63
63
  const getSafeTransactionData = (transactions) => {
64
64
  const safeTransactionData = [];
65
65
  for (const transaction of transactions) {
66
66
  safeTransactionData.push({
67
- "to": transaction.to ?? hardhat_1.ethers.constants.AddressZero,
68
67
  "data": transaction.data?.toString() ?? "0x",
69
- "value": transaction.value?.toString() ?? "0",
70
- "operation": 0
68
+ "operation": safe_core_sdk_types_1.OperationType.Call,
69
+ "to": transaction.to ?? hardhat_1.ethers.constants.AddressZero,
70
+ "value": transaction.value?.toString() ?? "0"
71
71
  });
72
72
  }
73
73
  return safeTransactionData;
@@ -91,8 +91,8 @@ const getSafeService = async () => {
91
91
  const { chainId } = await hardhat_1.ethers.provider.getNetwork();
92
92
  const ethAdapter = await getEthAdapter();
93
93
  const safeService = new api_kit_1.default({
94
- "txServiceUrl": getSafeTransactionUrl(chainId),
95
- ethAdapter
94
+ ethAdapter,
95
+ "txServiceUrl": getSafeTransactionUrl(chainId)
96
96
  });
97
97
  return safeService;
98
98
  };
@@ -152,8 +152,8 @@ const createMultiSendTransaction = async (safeAddress, transactions) => {
152
152
  safeAddress
153
153
  });
154
154
  const safeTransaction = await safeSdk.createTransaction({
155
- safeTransactionData,
156
- options
155
+ options,
156
+ safeTransactionData
157
157
  });
158
158
  await estimateSafeTransaction(safeAddress, safeTransactionData);
159
159
  await proposeTransaction(safeAddress, safeTransaction);
@@ -15,10 +15,10 @@ class EoaSubmitter extends submitter_1.Submitter {
15
15
  console.log(`Send transaction via ${this.name}`);
16
16
  const responses = await Promise.all(transactions.
17
17
  map((transaction, index) => deployer.sendTransaction({
18
- "to": transaction.to,
19
- "value": transaction.value,
20
18
  "data": transaction.data,
21
- "nonce": nonce + index
19
+ "nonce": nonce + index,
20
+ "to": transaction.to,
21
+ "value": transaction.value
22
22
  })));
23
23
  console.log("Waiting for transactions");
24
24
  await Promise.all(responses.map((response) => response.wait()));
@@ -58,8 +58,9 @@ class SafeImaMarionetteSubmitter extends safe_to_ima_submitter_1.SafeToImaSubmit
58
58
  }
59
59
  await super.submit([
60
60
  {
61
- "to": this.marionette.address,
62
- "data": await this.marionette.encodeFunctionCalls(functionCalls)
61
+ "data": await this.marionette.
62
+ encodeFunctionCalls(functionCalls),
63
+ "to": this.marionette.address
63
64
  }
64
65
  ]);
65
66
  }
@@ -15,12 +15,12 @@ class SafeToImaSubmitter extends safe_submitter_1.SafeSubmitter {
15
15
  }
16
16
  const messageProxyForMainnet = await this.getMessageProxyForMainnet();
17
17
  const transactionsToIma = transactions.map((transaction) => ({
18
- "to": messageProxyForMainnet.address,
19
18
  "data": messageProxyForMainnet.interface.encodeFunctionData("postOutgoingMessage", [
20
19
  this.targetSchainHash,
21
20
  transaction.to,
22
21
  transaction.data
23
- ])
22
+ ]),
23
+ "to": messageProxyForMainnet.address
24
24
  }));
25
25
  await super.submit(transactionsToIma);
26
26
  }
@@ -103,11 +103,11 @@ class Upgrader {
103
103
  ` to ${contract.implementationAddress}`;
104
104
  console.log(chalk_1.default.yellowBright(infoMessage));
105
105
  this.transactions.push({
106
- "to": proxyAdmin.address,
107
106
  "data": proxyAdmin.interface.encodeFunctionData("upgrade", [
108
107
  contract.proxyAddress,
109
108
  contract.implementationAddress
110
- ])
109
+ ]),
110
+ "to": proxyAdmin.address
111
111
  });
112
112
  }
113
113
  }
@@ -127,9 +127,9 @@ class Upgrader {
127
127
  });
128
128
  if (newImplementationAddress !== currentImplementationAddress) {
129
129
  return {
130
- proxyAddress,
131
130
  "implementationAddress": newImplementationAddress,
132
- "name": contract
131
+ "name": contract,
132
+ proxyAddress
133
133
  };
134
134
  }
135
135
  console.log(chalk_1.default.gray(`Contract ${contract} is up to date`));
@@ -54,9 +54,9 @@ const verify = async (contractName, contractAddress, constructorArguments) => {
54
54
  return;
55
55
  }
56
56
  await verifyWithRetry({
57
- contractName,
57
+ constructorArguments,
58
58
  contractAddress,
59
- constructorArguments
59
+ contractName
60
60
  }, RETRIES_AMOUNT);
61
61
  };
62
62
  exports.verify = verify;
@@ -20,8 +20,8 @@ const getVersionFilename = async (folder) => {
20
20
  return path;
21
21
  }
22
22
  for (const entry of await fs_1.promises.readdir(folder, {
23
- "withFileTypes": true,
24
- "recursive": true
23
+ "recursive": true,
24
+ "withFileTypes": true
25
25
  })) {
26
26
  if (entry.isFile() && entry.name === VERSION_FILENAME) {
27
27
  return `${entry.path}/${entry.name}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalenetwork/upgrade-tools",
3
- "version": "3.0.0-linter.25",
3
+ "version": "3.0.0-linter.26",
4
4
  "description": "Scripts to support upgrades of smart contracts",
5
5
  "files": [
6
6
  "dist/**/*"