From 232b4913449f64ff48992586d37e7ca059d1c9b3 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 15:21:58 +0200 Subject: [PATCH 01/12] Remove estimateSafeTransaction --- src/gnosis-safe.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 2fdd601..6563877 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -51,31 +51,11 @@ export async function createMultiSendTransaction(safeAddress: string, transactio const ethAdapter = await getEthAdapter(); const safeSdk = await Safe.create({ ethAdapter, safeAddress }) const safeTransaction = await safeSdk.createTransaction({ safeTransactionData, options }) - - await estimateSafeTransaction(safeAddress, safeTransactionData); - await proposeTransaction(safeAddress, safeTransaction); } // private functions -async function estimateSafeTransaction(safeAddress: string, safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[]) { - console.log("Estimate gas"); - const safeService: SafeServiceClient = await getSafeService(); - for (const transaction of safeTransactionData as MetaTransactionData[]) { - const estimateResponse = await safeService.estimateSafeTransaction( - safeAddress, - { - to: transaction.to, - value: transaction.value, - data: transaction.data, - operation: transaction.operation || 0, - } - ); - console.log(chalk.cyan(`Recommend to set gas limit to ${parseInt(estimateResponse.safeTxGas, 10)}`)); - } - console.log(chalk.green("Send transaction to gnosis safe")); -} async function proposeTransaction(safeAddress: string, safeTransaction: SafeTransaction) { const [ safeOwner ] = await ethers.getSigners(); From a94f55b37ef5516496b28e795ae9a8fbd530e61b Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 15:22:16 +0200 Subject: [PATCH 02/12] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0e6d3b..3d3f03d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/upgrade-tools", - "version": "2.0.1", + "version": "2.0.2", "description": "Scripts to support upgrades of smart contracts", "files": [ "dist/**/*" From 5d8a8b3f495f4eb050354861517dc417a8933606 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:21:00 +0200 Subject: [PATCH 03/12] Fix GA --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9f0419..8c96f20 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,7 +44,10 @@ jobs: yarn yarn install-peers - - name: Compile typescript + - name: Compile TypeScript (First time) + run: yarn compile + + - name: Compile TypeScript (Second time) run: yarn compile - name: Determine version From e931ee00cec3b36096a655eaa9ef196f59c6aa09 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:23:48 +0200 Subject: [PATCH 04/12] Fix build --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8c96f20..0af4f76 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,10 +45,11 @@ jobs: yarn install-peers - name: Compile TypeScript (First time) - run: yarn compile + run: yarn compile || true - name: Compile TypeScript (Second time) run: yarn compile + continue-on-error: true - name: Determine version run: | From 35a31d5b6105360d73bc9aebc3b7de938f4b9c20 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:44:20 +0200 Subject: [PATCH 05/12] Fix build --- hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 9d88808..25ddee6 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,7 +7,7 @@ const config: HardhatUserConfig = { solidity: { compilers: [ { - version: '0.8.11', + version: '0.8.13', settings: { optimizer: { enabled: true, From 39429cc149c8f6a117bbc30a97c82636cc87daf6 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:45:40 +0200 Subject: [PATCH 06/12] Fix build --- .github/workflows/publish.yml | 6 +----- hardhat.config.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0af4f76..4cb8615 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,12 +44,8 @@ jobs: yarn yarn install-peers - - name: Compile TypeScript (First time) - run: yarn compile || true - - - name: Compile TypeScript (Second time) + - name: Compile TypeScript run: yarn compile - continue-on-error: true - name: Determine version run: | diff --git a/hardhat.config.ts b/hardhat.config.ts index 25ddee6..9d88808 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,7 +7,7 @@ const config: HardhatUserConfig = { solidity: { compilers: [ { - version: '0.8.13', + version: '0.8.11', settings: { optimizer: { enabled: true, From a89dc33b1da2620cd2cafbd26c0e0b117e2bc4ef Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:51:27 +0200 Subject: [PATCH 07/12] Update node version --- .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4cb8615..cee2472 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ on: - beta - develop env: - NODE_VERSION: 16 + NODE_VERSION: 20 jobs: build: @@ -44,7 +44,7 @@ jobs: yarn yarn install-peers - - name: Compile TypeScript + - name: Compile typeScript run: yarn compile - name: Determine version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c339640..e71ae21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 18.x] + node-version: [18.x, 20.x, 21.x] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index 3d3f03d..126ec9a 100644 --- a/package.json +++ b/package.json @@ -39,11 +39,11 @@ "typescript": "^4.5.5" }, "dependencies": { + "@openzeppelin/contracts-upgradeable": "^4.4.2", "@safe-global/safe-core-sdk": "^3.3.2", "@safe-global/safe-core-sdk-types": "^1.9.0", "@safe-global/safe-ethers-lib": "^1.9.2", "@safe-global/safe-service-client": "^2.0.0", - "@openzeppelin/contracts-upgradeable": "^4.4.2", "axios": "^0.27.2", "ethereumjs-util": "^7.1.4" }, From 1751748d7128c50fed2a8d869526c5a4afe25812 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 16:57:57 +0200 Subject: [PATCH 08/12] Upgrade hardhat --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 126ec9a..e4fdcaa 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,6 @@ "@openzeppelin/upgrades-core": "^1.12.0", "@types/mocha": "^9.1.0", "ethers": "^5.7.2", - "hardhat": "2.8.3 - 2.16.1" + "hardhat": "^2.16.1" } } From 1048df890c0400111e55547d09dff476e6a1c597 Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 17:00:10 +0200 Subject: [PATCH 09/12] Fix linter --- src/gnosis-safe.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 6563877..f59b598 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -1,9 +1,8 @@ -import chalk from "chalk"; import { ethers } from "hardhat"; import { UnsignedTransaction } from "ethers"; import EthersAdapter from '@safe-global/safe-ethers-lib' import SafeServiceClient from '@safe-global/safe-service-client' -import { MetaTransactionData, SafeTransactionDataPartial, SafeTransaction } from '@safe-global/safe-core-sdk-types' +import { MetaTransactionData, SafeTransaction } from '@safe-global/safe-core-sdk-types' import Safe, { SafeTransactionOptionalProps } from '@safe-global/safe-core-sdk' enum Network { From b913c3b72d15e7337e10bc563f0099885599ac3b Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 17:05:15 +0200 Subject: [PATCH 10/12] Move back node 16.x --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e71ae21..3e24b70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 21.x] + node-version: [16.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 From e2f37890f5ffaabd2a95bde52774c523f473fa7e Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 17:11:02 +0200 Subject: [PATCH 11/12] Remove node 16.x --- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cee2472..2b7c401 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,7 +44,7 @@ jobs: yarn yarn install-peers - - name: Compile typeScript + - name: Compile typescript run: yarn compile - name: Determine version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e24b70..6fef3e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x, 20.x] + node-version: [18.x, 20.x] steps: - uses: actions/checkout@v2 From e91d7f2cc0aee1a45bc578ecfccfe56cb4dcf7ca Mon Sep 17 00:00:00 2001 From: Vadim Yavorsky Date: Fri, 12 Jan 2024 17:51:52 +0200 Subject: [PATCH 12/12] Fix linter --- src/gnosis-safe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 3954574..37f7c1d 100644 --- a/src/gnosis-safe.ts +++ b/src/gnosis-safe.ts @@ -2,7 +2,7 @@ import { ethers } from "hardhat"; import { UnsignedTransaction } from "ethers"; import SafeApiKit from '@safe-global/api-kit' import Safe, { EthersAdapter } from '@safe-global/protocol-kit' -import { MetaTransactionData, SafeTransactionDataPartial, SafeTransaction } from '@safe-global/safe-core-sdk-types' +import { MetaTransactionData, SafeTransaction } from '@safe-global/safe-core-sdk-types' enum Network {