From a6786413e438fe8d441c2e1d32ad764b332b8997 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 5 Jun 2025 10:19:00 +0200 Subject: [PATCH] Remove HARDHAT_NETWORK and update documentation --- Readme.md | 42 ++++-------------------------------------- package.json | 5 ++--- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/Readme.md b/Readme.md index a7e962b..93ae01c 100644 --- a/Readme.md +++ b/Readme.md @@ -22,40 +22,13 @@ To start a local Ethereum node with the contracts deployed, execute: npm start -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 -``` - -To reuse a previously deployed `Token` contract, define the environment variable `TOKEN_ADDRESS`. -The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract -instead of deploying a new one. - Deployment ---------- -To deploy the marketplace you need to define `HARDHAT_NETWORK`: +To deploy the marketplace, you need to specify the network using `--network MY_NETWORK`: ```bash -HARDHAT_NETWORK=localhost npm run deploy -``` - -Or you can you `npx` directly: - -```bash -npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost +npm run deploy -- --network localhost ``` Hardhat uses [reconciliation](https://hardhat.org/ignition/docs/advanced/reconciliation) to recover @@ -64,21 +37,14 @@ In our case, we will likely redeploy a new contract every time, so we will need [clear the previous deployment](https://hardhat.org/ignition/docs/guides/modifications#clearing-an-existing-deployment-with-reset): ```bash -HARDHAT_NETWORK=localhost npm run deploy:reset -``` - -Or you can you `npx` directly: - -```bash -npx hardhat ignition deploy ignition/modules/marketplace.js --network localhost --reset +npm run deploy -- --network testnet --reset ``` To reuse a previously deployed `Token` contract, define the environment variable `TOKEN_ADDRESS`. The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract instead of deploying a new one. -The deployment files are kept under version control [as recommended by Hardhat](https://hardhat.org/ignition/docs/advanced/versioning), -except the build files, which are 18 MB. +The deployment files are kept under version control [as recommended by Hardhat](https://hardhat.org/ignition/docs/advanced/versioning), except the build files, which are 18 MB. Running the prover ------------------ diff --git a/package.json b/package.json index 723da3e..3081b64 100644 --- a/package.json +++ b/package.json @@ -4,13 +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 mine && HARDHAT_NETWORK=localhost npm run deploy\"", + "start": "concurrently --names \"hardhat,deployment\" --prefix \"[{time} {name}]\" \"hardhat node\" \"sleep 2 && npm run mine && npm run deploy -- --network localhost\"", "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 $HARDHAT_NETWORK", - "deploy:reset": "hardhat ignition deploy ignition/modules/marketplace.js --network $HARDHAT_NETWORK --reset", + "deploy": "hardhat ignition deploy ignition/modules/marketplace.js", "mine": "hardhat run scripts/mine.js --network localhost", "verify": "npm run verify:marketplace && npm run verify:state_changes", "verify:marketplace": "certoraRun certora/confs/Marketplace.conf",