diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d247b37..2b7c401 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,7 @@ on: - beta - develop env: - NODE_VERSION: 18 + NODE_VERSION: 20 jobs: build: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ed5f04..380230d 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 diff --git a/package.json b/package.json index da1f7f2..02f2c25 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,6 @@ "@openzeppelin/upgrades-core": "^1.27.1", "@types/mocha": "^9.1.0", "ethers": "^5.7.2", - "hardhat": "2.8.3 - 2.16.1" + "hardhat": "^2.16.1" } } diff --git a/src/gnosis-safe.ts b/src/gnosis-safe.ts index 7972bb3..37f7c1d 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 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 { @@ -53,30 +52,11 @@ export async function createMultiSendTransaction(safeAddress: string, transactio safeSdk = await Safe.create({ ethAdapter, safeAddress }), 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 = 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