This project was created to research about smart contracts on Solidity to be deployed and executed in EVM.
It uses Hardhat, OpenZeppelin, chai, etc.
After clone the repository just install all dependencies.
npm install
Copy the .env.example
file in this directory to .env
(which will be ignored by Git)
cp .env.example .env
Then set each variable on .env
:
ALCHEMY_RINKEBY_URL
: The Alchemy URL got from your account.PRIVATE_KEY
: Private key of the account being used to deploy contract in Rinkeby testnet (Ethereum).ETHERSCAN_API_KEY
: Etherscan API Key got from Etherscan website.MNEMONIC
: Mnemonic of the account being used to deploy contract in Binance Smart Chain Testnet.
To execute test script just run:
npm run test
It wlll deploy contract to local network, execute all test and finalize destroy everything.
To execute coverage test script just run:
npm run coverage
To deploy smart contract to Rinkeby (Ethereum testnet):
npm run deploy:rinkeby
To deploy smart contract to BSC testnet:
npm run deploy:bsc-testnet
Try running some of the following tasks:
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help
- contracts > Run test on smart contract
- generate > Generate X number of NFT images
- ipfs > Upload these images to ipfs using Pinata. Get CID (i.e. QmTiEQ4LLmaMFpsUTbDJthgnCoPygXmiaXRFU8DvsZvUD2)
- generate > Update
constants.js
and set ipfs:// onipfsImagePath
(i.e. https://ipfs.io/ipfs/QmTiEQ4LLmaMFpsUTbDJthgnCoPygXmiaXRFU8DvsZvUD2) - generate > Run script
update-image-metadata.js
to changeimage
path in all json metadata files. - ipfs > Upload json metadata to Pinata. Get CID
- contracts > Update
deploy.js
to set X as max supply andhttps://ipfs.io/ipfs/<CID>
as baseURL - contracts > Deploy smart contract
- contracts > Verify and validate contracts in Etherscan. Generate flatten using
npx hardhat flatten > contract-flatten.sol
. Remove all licenses and set only one on top (SPDX-License-Identifier: MIT
) - etherscan > Complete form