@lootproject https://lootproject.com
Solidity Contract Template based on LootSource: https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7
Loot is a NFT that took the NFT world by storm. It redefines what an NFT could be. A characteristic of a loot NFT is all data is contained on chain. No IPFS or external hosting used. They did this in a very gas efficient way for the minter as most computation is offloaded to the read function. Loot has become a prime example on how to create on-chain NFTs.
This contract showcase how you will want to structure your contract to create an on-chain NFT, the key is to not construct the metadata during minting, but offload everything to a read function. Although deployment might be costly, it makes minting gas efficient.
Curated by @marcelc63 - marcelchristianis.com Each functions have been annotated based on my own research.
Feel free to use and modify as you see appropriate
Using the Template
Please do the followings
- Modify any code that's labeled with TODO
- Change the baseURI in deploy.js, run.js, and test.js
- Make sure to create your own .env and modify hardhat.config.js accordingly with your deployment URL and accounts private key.
- Remove the comments and annotation
Included in the Template
- Contract that CoolCatsNFT used
- Complete commentary on core functions
- Deployment Script
- Testing Script
Commands to use
// To test
npx hardhat run scripts/run.js
npx hardhat test
// To deploy to Rinkeby testnet
npx hardhart run scripts/deploy.js --network rinkeby