From ca9f9b0142ff6c8f2dccbf5f9d18c2a7f7800ea7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Sep 2024 11:42:00 +0200 Subject: [PATCH] fix script --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 8 ++++---- .../contract-deployer/basic-contract-deploy.ts | 2 +- .../contract-deployer/create2-factory-deploy.ts | 2 +- .../templates/gnosisSafeMultisig/scripts/ethers-lib.ts | 2 +- .../src/templates/ozerc1155/scripts/ethers-lib.ts | 2 +- .../src/templates/ozerc20/scripts/ethers-lib.ts | 2 +- .../src/templates/ozerc721/scripts/ethers-lib.ts | 2 +- .../src/templates/playground/scripts/ethers-lib.ts | 2 +- .../src/templates/remixDefault/scripts/ethers-lib.ts | 2 +- .../src/templates/zeroxErc20/scripts/ethers-lib.ts | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 0ea0cb3263..8cdfd8ce3b 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -501,7 +501,7 @@ const deployWithEthersJs = ` const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner() + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner() let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) @@ -531,7 +531,7 @@ describe("Storage with lib", function () { it("test initial value", async function () { // Make sure contract is compiled and artifacts are generated const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json')) - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner() + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner() let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); console.log('storage contract Address: ' + storage.address); @@ -541,7 +541,7 @@ describe("Storage with lib", function () { it("test updating and retrieving updated value", async function () { const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json')) - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner() + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner() let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); await storage.waitForDeployment() @@ -552,7 +552,7 @@ describe("Storage with lib", function () { it("fail test updating and retrieving updated value", async function () { const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json')) - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner() + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner() let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); await storage.waitForDeployment() diff --git a/libs/remix-ws-templates/src/script-templates/contract-deployer/basic-contract-deploy.ts b/libs/remix-ws-templates/src/script-templates/contract-deployer/basic-contract-deploy.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/script-templates/contract-deployer/basic-contract-deploy.ts +++ b/libs/remix-ws-templates/src/script-templates/contract-deployer/basic-contract-deploy.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/script-templates/contract-deployer/create2-factory-deploy.ts b/libs/remix-ws-templates/src/script-templates/contract-deployer/create2-factory-deploy.ts index 65f6ab8bce..5bd4cace4c 100644 --- a/libs/remix-ws-templates/src/script-templates/contract-deployer/create2-factory-deploy.ts +++ b/libs/remix-ws-templates/src/script-templates/contract-deployer/create2-factory-deploy.ts @@ -15,7 +15,7 @@ export const CREATE2_DEPLOYER_ADDRESS = '0x13b0D85CcB8bf860b6b79AF3029fCA081AE9b export const deploy = async (contractName: string, args: Array, salt: string, accountIndex?: number): Promise => { console.log(`deploying ${contractName}`) - const signer = new ethers.BrowserProvider(web3Provider).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.Contract(CREATE2_DEPLOYER_ADDRESS, contractDeployerAbi, signer) //@ts-ignore diff --git a/libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/ozerc1155/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/ozerc1155/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/ozerc1155/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/ozerc1155/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/ozerc20/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/ozerc20/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/ozerc20/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/ozerc20/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/ozerc721/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/ozerc721/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/ozerc721/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/ozerc721/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/playground/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/playground/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/playground/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/playground/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/remixDefault/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/remixDefault/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/remixDefault/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/remixDefault/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) diff --git a/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/ethers-lib.ts b/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/ethers-lib.ts index 20ae79477e..ea41ec2d21 100644 --- a/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/ethers-lib.ts +++ b/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/ethers-lib.ts @@ -17,7 +17,7 @@ export const deploy = async (contractName: string, args: Array, accountInde const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) + const signer = await (new ethers.BrowserProvider(web3Provider)).getSigner(accountIndex) const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)