1 . Clone this repo:
g
2 . Change into the directory:
cd hardhat-nft-smart-contract
3 . Install dependencies:
npm install
4 . Set up environment variables:
cp .env.example .env
Replace the values of the variables you need in the .env
file with yours.
5 . Set up project-config.ts
:
- Replace the file paths with yours
- Replace
hiddenMetadataUri
with yours
npx hardhat test
1 . Network: hardhat(default)
:
npx hardhat deploy
2 . Network: localhost
:
npx hardhat node
Launch another terminal and run the following command:
npx hardhat deploy --network localhost
3 . Network: rinkeby/mainnet/mumbai/polygon
:
npx deploy --network <networkName>
4 . Tags
:
Deploying without the --tags <tags>
option runs all deploy scripts in the deploy
directory.
For example, if you want to run only deploy/02-update-front-end.ts
using the rinkeby
network:
npx hardhat deploy --network rinkeby --tags updateFrontEnd
The tag name is set at the bottom of the deploy script file.
Using Hardhat Network and running only
deploy/02-update-front-end.ts
will result in an error.
1 . Open allowlist sale:
npm run open-allowlist -- --network <networkName>
2 . Open public sale:
npm run open-public -- --network <networkName>
3 . Close sales:
npm run close -- --network <networkName>
4 . Reveal collection:
npm run reveal -- --network <networkName>