Clone this repo and install dependencies:
git clone https://github.com/stackosofficial/node-nft-contract
cd ./STACKNFT
npm install
Rename .env.template to .env, open it and then enter your:
- Rinkeby node URL (e.g. from Alchemy or Infura)
- If you use non-archival node, remove
blockNumberfrom hardhat config. Alchemy should be archival by default.
- If you use non-archival node, remove
- Matic node URL (e.g. from Alchemy or Infura)
- The private key of the account which will send the deployment transaction
- POLYGONSCAN or ETHERSCAN api key depends where you wish to deploy, matic or rinkeby (get one here)
- Run tests
npx hardhat test
- Open the file scripts/deploy.js and fill settings with your details
- Adjust chainlink
feevariable in contracts/StackOsNFT.sol (see actual fees here)
Verification will run automatically after deployment.
Rinkeby testnet:
npx hardhat run --network rinkeby scripts/deploy.jsMatic:
npx hardhat run --network matic scripts/deploy.jsMainnet:
To setup FakeRouter run the following script from the owner of the Exchange contract to test it locally:
npx hardhat run scripts/setupFakeRouter.jsnpx hardhat run scripts/setupFakeRouter.js --network maticnpx hardhat run scripts/setupDefaultRouter.js --network matic