From 299d0fe37574b53138ffbaace6bce69e2bdc9143 Mon Sep 17 00:00:00 2001 From: SnowShield Date: Fri, 8 Apr 2022 12:31:51 +0300 Subject: [PATCH 1/3] Forknet deploy utils --- .env.example | 9 +++++---- README.md | 2 +- hardhat.config.js | 6 ++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 166127c..fdd1984 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -ETHERSCAN_KEY= -ALCHEMY_KEY= -PRIVATE_KEY= -INFURA_API_KEY= +ETHERSCAN_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +ALCHEMY_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 +INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1 +FORKNET_RPC_URL=https://link-to.fork diff --git a/README.md b/README.md index 2463325..a9376b2 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Check addresses with current config: node -e 'require("./src/generateAddresses").generateWithLog()' ``` -Deploy InstanceFactory: +Deploy MultipleInstanceFactory: ```shell yarn hardhat run scripts/deployMultipleInstanceFactory.js --network mainnet diff --git a/hardhat.config.js b/hardhat.config.js index f03f3e1..e1b7bd1 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -69,6 +69,12 @@ module.exports = { ? [process.env.PRIVATE_KEY] : { mnemonic: 'test test test test test junk' }, }, + forknet: { + url: process.env.FORKNET_RPC_URL, + accounts: process.env.PRIVATE_KEY + ? [process.env.PRIVATE_KEY] + : { mnemonic: 'test test test test test junk' }, + }, }, mocha: { timeout: 9999999999 }, spdxLicenseIdentifier: { From 9db29f2ededee70056cb213d684a1d6c9c73d4fc Mon Sep 17 00:00:00 2001 From: SnowShield Date: Fri, 8 Apr 2022 17:43:35 +0300 Subject: [PATCH 2/3] Fix compile without FORKNET_RPC_URL env --- hardhat.config.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index e1b7bd1..fd26f05 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -69,12 +69,16 @@ module.exports = { ? [process.env.PRIVATE_KEY] : { mnemonic: 'test test test test test junk' }, }, - forknet: { - url: process.env.FORKNET_RPC_URL, - accounts: process.env.PRIVATE_KEY - ? [process.env.PRIVATE_KEY] - : { mnemonic: 'test test test test test junk' }, - }, + ...(typeof process.env.FORKNET_RPC_URL === 'string' + ? { + forknet: { + url: process.env.FORKNET_RPC_URL, + accounts: process.env.PRIVATE_KEY + ? [process.env.PRIVATE_KEY] + : { mnemonic: 'test test test test test junk' }, + }, + } + : {}), }, mocha: { timeout: 9999999999 }, spdxLicenseIdentifier: { From 09899edcb25c986882f6ecbff2f161e0eb8258cc Mon Sep 17 00:00:00 2001 From: SnowShield Date: Fri, 8 Apr 2022 17:58:31 +0300 Subject: [PATCH 3/3] Fix eslint-prettier battle --- hardhat.config.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index fd26f05..233dad7 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -69,16 +69,14 @@ module.exports = { ? [process.env.PRIVATE_KEY] : { mnemonic: 'test test test test test junk' }, }, - ...(typeof process.env.FORKNET_RPC_URL === 'string' - ? { - forknet: { - url: process.env.FORKNET_RPC_URL, - accounts: process.env.PRIVATE_KEY - ? [process.env.PRIVATE_KEY] - : { mnemonic: 'test test test test test junk' }, - }, - } - : {}), + ...(typeof process.env.FORKNET_RPC_URL === 'string' && { + forknet: { + url: process.env.FORKNET_RPC_URL, + accounts: process.env.PRIVATE_KEY + ? [process.env.PRIVATE_KEY] + : { mnemonic: 'test test test test test junk' }, + }, + }), }, mocha: { timeout: 9999999999 }, spdxLicenseIdentifier: {