From a9331363525b0673f96f85543a2c2b5f82891501 Mon Sep 17 00:00:00 2001 From: Pascal Marco Caversaccio Date: Thu, 4 Nov 2021 12:06:28 +0100 Subject: [PATCH] further testing feedback included --- README.md | 1 + package-lock.json | 2 +- package.json | 5 ++++- src/index.ts | 28 ++++++++-------------------- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 1fcbba4..e84977e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This plugin will help you make easier and safer usage of the [`CREATE2`](https:/ ```bash npm install --save-dev xdeployer @nomiclabs/hardhat-ethers ``` +> **Note:** This plugin uses the optional chaining operator (`?.`). Optional chaining is _not_ supported in Node.js v13 and below. Import the plugin in your `hardhat.config.js`: ```js diff --git a/package-lock.json b/package-lock.json index 050ecbd..22f819d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "xdeployer", - "version": "1.0.0", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 740d238..b52dbee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xdeployer", - "version": "1.0.3", + "version": "1.0.4", "description": "Hardhat plugin to deploy your smart contracts across multiple EVM chains with the same deterministic address.", "author": "Pascal Marco Caversaccio", "license": "MIT", @@ -20,6 +20,9 @@ "bugs": { "url": "https://github.com/pcaversaccio/xdeployer/issues" }, + "engines": { + "node": ">=14.0.0" + }, "scripts": { "prettier:check": "prettier -c src/**/*.{js,ts} test/**/*.{js,ts}", "prettier:fix": "prettier --write src/**/*.{js,ts} test/**/*.{js,ts}", diff --git a/src/index.ts b/src/index.ts index b2e5c2f..25a8f64 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,10 @@ task( let initcode: any; const dir = "./deployments"; + console.log( + "The deployment is starting... Please bear with me, this may take a minute or two. Anyway, WAGMI!" + ); + if (hre.config.xdeploy.constructorArgsPath && hre.config.xdeploy.contract) { const args = await import( path.normalize( @@ -109,18 +113,10 @@ task( path.join( hre.config.paths.root, "deployments", - `${hre.config.xdeploy.networks[i]}_depoyment.json` + `${hre.config.xdeploy.networks[i]}_deployment.json` ) ); - fs.writeFile( - saveDir, - JSON.stringify(createReceipt[i]), - function (err) { - if (err) { - console.log(err); - } - } - ); + fs.writeFileSync(saveDir, JSON.stringify(createReceipt[i])); console.log( `${hre.config.xdeploy.networks[i]} deployment successful with hash: ${createReceipt[i].hash}`, @@ -155,18 +151,10 @@ task( path.join( hre.config.paths.root, "deployments", - `${hre.config.xdeploy.networks[i]}_depoyment.json` + `${hre.config.xdeploy.networks[i]}_deployment.json` ) ); - fs.writeFile( - saveDir, - JSON.stringify(createReceipt[i]), - function (err) { - if (err) { - console.log(err); - } - } - ); + fs.writeFileSync(saveDir, JSON.stringify(createReceipt[i])); console.log( `${hre.config.xdeploy.networks[i]} deployment successful with hash: ${createReceipt[i].hash}`,