Skip to content

Commit 4efd99a

Browse files
author
-
committed
Corrected utils path;
Added checj for existence of factory.
1 parent 794b6fa commit 4efd99a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/deployViaCREATE3-TESTERC20UG.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const saltForCREATE3 = ethers.encodeBytes32String(`SKYBIT.ASIA TESTERC20UG......
1818

1919

2020
async function main() {
21-
const { rootRequire, printNativeCurrencyBalance, verifyContract } = require(`../utils`)
21+
const { rootRequire, printNativeCurrencyBalance, verifyContract } = require(`./utils`)
2222

2323
const [wallet, wallet2] = await ethers.getSigners()
2424
console.log(`Using network: ${network.name} (${network.config.chainId}), account: ${wallet.address} having ${await printNativeCurrencyBalance(wallet.address)} of native currency, RPC url: ${network.config.url}`)
@@ -52,6 +52,11 @@ async function main() {
5252

5353
let proxyAddressExpected
5454
if (useCREATE3) {
55+
if (await ethers.provider.getCode(factoryToUse.address) === `0x`) {
56+
console.error(`CREATE3 factory was not found at ${factoryToUse.address} on ${network.name}. Deploy the factory there first (or update the factory address to the correct one) then rerun this script.`)
57+
return
58+
}
59+
5560
const { getArtifactOfFactory, getDeployedAddress } = rootRequire(`scripts/CREATE3-deploy-functions.js`)
5661
const artifactOfFactory = getArtifactOfFactory(factoryToUse.name)
5762
const instanceOfFactory = await ethers.getContractAt(artifactOfFactory.abi, factoryToUse.address)

0 commit comments

Comments
 (0)