Table of Contents
This project contains the source code of Launchpad NFT project, supports deploying, testing smart contracts and getting information about chain Id, address and abi to help front-end interact with these smart contracts.
- npm
npm install npm@latest -g
- yarn
npm install --global yarn
- Clone the repo
git clone https://gitlab.com/illumia-project/nft-amm-smartcontract.git
- Install packages
yarn
yarn hardhat deploy
yarn hardhat test
yarn hardhat coverage
MAINNET_RPC_URL='https://eth-mainnet.g.alchemy.com/v2/your-api-key'
GOERLI_RPC_URL='https://eth-goerli.g.alchemy.com/v2/your-api-key'
PRIVATE_KEY='YOUR_PRIVATE_KEY'
REPORT_GAS=false
ETHERSCAN_API_KEY='YOUR_API_KEY'
MAINNET_RPC_URL
: This is url of the mainnet node you're working with. You can get setup with one for free from AlchemyGOERLI_RPC_URL
: This is url of the goerli testnet node you're working with. You can get setup with one for free from AlchemySEPOLIA_RPC_URL
: This is url of the sepolia testnet node you're working with. You can get setup with one for free from InfuraPRIVATE_KEY
: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT.- You can learn how to export it here.
ETHERSCAN_API_KEY
: This is the api key used for smart contract verification on etherscan. You can get one for free here Etherscan
- Get testnet ETH
- You can get testnet eth by mining here Faucet Link
- Deploy & Verify
- Testnet:
yarn hardhat deploy --network <NETWORK> --tags "main"
- Mainnet:
PRIVATE_KEY=<YOUR_PRIVATE_KEY> yarn hardhat deploy --network mainnet --tags "main"
history -c
The first contract deployed on a network needs to be verified, and similar contracts are automatically verified.
yarn hardhat verify --constructor-args arguments.ts <CONTRACT_ADDRESS> --network <NETWORK>