From 28cf61f45e3b1aa6becce9132fc9f5cfdd1ccd99 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 22 May 2025 17:38:13 +0200 Subject: [PATCH] Use HARDHAT_NETWORK env variable to deploy marketplace contract --- Readme.md | 13 +++++++++++++ package.json | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index c5e8872..7dc4bfb 100644 --- a/Readme.md +++ b/Readme.md @@ -25,6 +25,19 @@ To start a local Ethereum node with the contracts deployed, execute: This will create a `deployment-localhost.json` file containing the addresses of the deployed contracts. +To deploy the marketplace you can define `HARDHAT_NETWORK` and run the following command: + +```bash +npm run deploy +# Example +# HARDHAT_NETWORK=localhost npm run deploy +``` + +Or you can you `npx` directly: + +```bash +npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost +``` Running the prover ------------------ diff --git a/package.json b/package.json index 2a95233..92644ab 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "scripts": { "test": "npm run lint && hardhat test", "fuzz": "hardhat compile && fuzzing/fuzz.sh", - "start": "concurrently --names \"hardhat,deployment\" --prefix \"[{time} {name}]\" \"hardhat node\" \"sleep 2 && npm run deploy\"", + "start": "concurrently --names \"hardhat,deployment\" --prefix \"[{time} {name}]\" \"hardhat node\" \"sleep 2 && HARDHAT_NETWORK=localhost npm run deploy\"", "compile": "hardhat compile", "format": "prettier --write test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol ", "format:check": "prettier --check test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol", "lint": "solhint contracts/**.sol", - "deploy": "hardhat ignition deploy ignition/modules/marketplace.js --network localhost", + "deploy": "hardhat ignition deploy ignition/modules/marketplace.js --network $HARDHAT_NETWORK", "predeploy": "hardhat run scripts/mine.js --network localhost", "verify": "npm run verify:marketplace && npm run verify:state_changes", "verify:marketplace": "certoraRun certora/confs/Marketplace.conf",