This the blockchain project that sold 3K+ NFTs in 4 hours on Ethereum using JavaScript and Solidity.
OPENSEA SeatBelt On!
on testnet rinkeby: https://rinkeby.etherscan.io/address/0xf49a30a3205E9E1f1AC748481f26BAeD344Fb3A9
use package hardhat...
once install packga "hardhat-shorthand", we can replace "hardhat" in cml by "hh"
yarn install
- set your .env file
- check the network settings in
hardhat.config.js
-
all contract
// assign network yarn hardhat deploy --network rinkeby // local network yarn hardhat deploy
-
specific contract
// tags decide in ./depoly/deploy.js yarn hardhat deploy --network rinkeby --tags "XXX"
Normally, it would verify automatically when deploy
If not, can run
-
without argument
yarn hardhat verify --network rinkeby "CONTRACT_ADDRESS"
-
with argument first create an argument.js file
yarn hardhat verify --network rinkeby --constructor-args arguments.js "CONTRACT_ADDRESS"
At the same time, can get the gas report
yarn hardhat test
- IPFS use filebase
- composite image HashLips/hashlips_art_enginePublic
Sructure
- The more often use function, put more ahead
- Replace if-else by ?:, and put easier fire situation into if statement
Function using
- Not override tokenURI(), by get rid of ".json" for each filename
- Use merkle tree, not array mapping
- Don't use totalSupply() from ERC721Enumerable.sol, which needs 2 override function, and cost 400000 gas more.
- Import Ownable.sol, not write on my own
- Less math calculate
yarn hardhat clean