diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index fb828248fe..a824c7871f 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -291,7 +291,7 @@ const deployWithEthersJs = ` // 'web3Provider' is a remix global variable object const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner() - let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let contract = await factory.deploy(...constructorArgs); @@ -320,7 +320,7 @@ describe("Storage with lib", 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.providers.Web3Provider(web3Provider)).getSigner() - let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); console.log('storage contract Address: ' + storage.address); await storage.deployed() @@ -330,7 +330,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.providers.Web3Provider(web3Provider)).getSigner() - let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); await storage.deployed() const setValue = await storage.store(56); @@ -341,7 +341,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.providers.Web3Provider(web3Provider)).getSigner() - let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) let storage = await Storage.deploy(); await storage.deployed() const setValue = await storage.store(56); diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index bfb210167e..7e7cfbd55e 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -75,7 +75,7 @@ module.exports = { .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { - browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => {`) !== -1, + browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') @@ -152,7 +152,7 @@ module.exports = { .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { - browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => {`) !== -1, + browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') @@ -200,7 +200,7 @@ module.exports = { .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { - browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => {`) !== -1, + browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') 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 99439abd49..e875db9a43 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 @@ -4,10 +4,10 @@ import { ethers } from 'ethers' * Deploy the given contract * @param {string} contractName name of the contract to deploy * @param {Array} args list of constructor' parameters - * @param {Number} acountIndex account index from the exposed account + * @param {Number} accountIndex account index from the exposed account * @return {Contract} deployed contract */ -export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => { +export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => { console.log(`deploying ${contractName}`) // Note that the script needs the ABI which is generated from the compilation artifact. @@ -17,11 +17,11 @@ export const deploy = async (contractName: string, args: Array, acountIndex const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(acountIndex) + const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex) - const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) - let contract = await factory.deploy(...args) + const contract = await factory.deploy(...args) // The contract is NOT deployed yet; we must wait until it is mined await contract.deployed() diff --git a/libs/remix-ws-templates/src/templates/ozerc20/scripts/web3-lib.ts b/libs/remix-ws-templates/src/templates/ozerc20/scripts/web3-lib.ts index be0c09a4ab..cbffde3aac 100644 --- a/libs/remix-ws-templates/src/templates/ozerc20/scripts/web3-lib.ts +++ b/libs/remix-ws-templates/src/templates/ozerc20/scripts/web3-lib.ts @@ -1,5 +1,5 @@ import Web3 from 'web3' -import { Contract, ContractSendMethod, Options } from 'web3-eth-contract'; +import { Contract, ContractSendMethod, Options } from 'web3-eth-contract' /** * Deploy the given contract @@ -21,9 +21,9 @@ export const deploy = async (contractName: string, args: Array, from?: stri const accounts = await web3.eth.getAccounts() - let contract: Contract = new web3.eth.Contract(metadata.abi) + const contract: Contract = new web3.eth.Contract(metadata.abi) - let contractSend: ContractSendMethod = contract.deploy({ + const contractSend: ContractSendMethod = contract.deploy({ data: metadata.data.bytecode.object, arguments: args }) 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 99439abd49..e875db9a43 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 @@ -4,10 +4,10 @@ import { ethers } from 'ethers' * Deploy the given contract * @param {string} contractName name of the contract to deploy * @param {Array} args list of constructor' parameters - * @param {Number} acountIndex account index from the exposed account + * @param {Number} accountIndex account index from the exposed account * @return {Contract} deployed contract */ -export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => { +export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => { console.log(`deploying ${contractName}`) // Note that the script needs the ABI which is generated from the compilation artifact. @@ -17,11 +17,11 @@ export const deploy = async (contractName: string, args: Array, acountIndex const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(acountIndex) + const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex) - const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) - let contract = await factory.deploy(...args) + const contract = await factory.deploy(...args) // The contract is NOT deployed yet; we must wait until it is mined await contract.deployed() diff --git a/libs/remix-ws-templates/src/templates/ozerc721/scripts/web3-lib.ts b/libs/remix-ws-templates/src/templates/ozerc721/scripts/web3-lib.ts index be0c09a4ab..cbffde3aac 100644 --- a/libs/remix-ws-templates/src/templates/ozerc721/scripts/web3-lib.ts +++ b/libs/remix-ws-templates/src/templates/ozerc721/scripts/web3-lib.ts @@ -1,5 +1,5 @@ import Web3 from 'web3' -import { Contract, ContractSendMethod, Options } from 'web3-eth-contract'; +import { Contract, ContractSendMethod, Options } from 'web3-eth-contract' /** * Deploy the given contract @@ -21,9 +21,9 @@ export const deploy = async (contractName: string, args: Array, from?: stri const accounts = await web3.eth.getAccounts() - let contract: Contract = new web3.eth.Contract(metadata.abi) + const contract: Contract = new web3.eth.Contract(metadata.abi) - let contractSend: ContractSendMethod = contract.deploy({ + const contractSend: ContractSendMethod = contract.deploy({ data: metadata.data.bytecode.object, arguments: args }) 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 99439abd49..e875db9a43 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 @@ -4,10 +4,10 @@ import { ethers } from 'ethers' * Deploy the given contract * @param {string} contractName name of the contract to deploy * @param {Array} args list of constructor' parameters - * @param {Number} acountIndex account index from the exposed account + * @param {Number} accountIndex account index from the exposed account * @return {Contract} deployed contract */ -export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => { +export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => { console.log(`deploying ${contractName}`) // Note that the script needs the ABI which is generated from the compilation artifact. @@ -17,11 +17,11 @@ export const deploy = async (contractName: string, args: Array, acountIndex const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(acountIndex) + const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex) - const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) - let contract = await factory.deploy(...args) + const contract = await factory.deploy(...args) // The contract is NOT deployed yet; we must wait until it is mined await contract.deployed() diff --git a/libs/remix-ws-templates/src/templates/remixDefault/scripts/web3-lib.ts b/libs/remix-ws-templates/src/templates/remixDefault/scripts/web3-lib.ts index be0c09a4ab..cbffde3aac 100644 --- a/libs/remix-ws-templates/src/templates/remixDefault/scripts/web3-lib.ts +++ b/libs/remix-ws-templates/src/templates/remixDefault/scripts/web3-lib.ts @@ -1,5 +1,5 @@ import Web3 from 'web3' -import { Contract, ContractSendMethod, Options } from 'web3-eth-contract'; +import { Contract, ContractSendMethod, Options } from 'web3-eth-contract' /** * Deploy the given contract @@ -21,9 +21,9 @@ export const deploy = async (contractName: string, args: Array, from?: stri const accounts = await web3.eth.getAccounts() - let contract: Contract = new web3.eth.Contract(metadata.abi) + const contract: Contract = new web3.eth.Contract(metadata.abi) - let contractSend: ContractSendMethod = contract.deploy({ + const contractSend: ContractSendMethod = contract.deploy({ data: metadata.data.bytecode.object, arguments: args }) 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 99439abd49..e875db9a43 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 @@ -4,10 +4,10 @@ import { ethers } from 'ethers' * Deploy the given contract * @param {string} contractName name of the contract to deploy * @param {Array} args list of constructor' parameters - * @param {Number} acountIndex account index from the exposed account + * @param {Number} accountIndex account index from the exposed account * @return {Contract} deployed contract */ -export const deploy = async (contractName: string, args: Array, acountIndex?: number): Promise => { +export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => { console.log(`deploying ${contractName}`) // Note that the script needs the ABI which is generated from the compilation artifact. @@ -17,11 +17,11 @@ export const deploy = async (contractName: string, args: Array, acountIndex const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath)) // 'web3Provider' is a remix global variable object - const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(acountIndex) + const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex) - const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer); + const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer) - let contract = await factory.deploy(...args) + const contract = await factory.deploy(...args) // The contract is NOT deployed yet; we must wait until it is mined await contract.deployed() diff --git a/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/web3-lib.ts b/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/web3-lib.ts index be0c09a4ab..cbffde3aac 100644 --- a/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/web3-lib.ts +++ b/libs/remix-ws-templates/src/templates/zeroxErc20/scripts/web3-lib.ts @@ -1,5 +1,5 @@ import Web3 from 'web3' -import { Contract, ContractSendMethod, Options } from 'web3-eth-contract'; +import { Contract, ContractSendMethod, Options } from 'web3-eth-contract' /** * Deploy the given contract @@ -21,9 +21,9 @@ export const deploy = async (contractName: string, args: Array, from?: stri const accounts = await web3.eth.getAccounts() - let contract: Contract = new web3.eth.Contract(metadata.abi) + const contract: Contract = new web3.eth.Contract(metadata.abi) - let contractSend: ContractSendMethod = contract.deploy({ + const contractSend: ContractSendMethod = contract.deploy({ data: metadata.data.bytecode.object, arguments: args })