This project demonstrates a simple implementation of an NFT (Non-Fungible Token) collection manager using JavaScript. The code includes functions to mint new NFTs, list all minted NFTs, and get the total supply of NFTs created.
Minting NFTs: Create new NFTs by providing metadata such as name, eye color, shirt type, and bling. The metadata is stored in an object and added to the NFT collection. Listing NFTs: Display all the NFTs in the collection along with their metadata. Total Supply: Retrieve and display the total number of NFTs minted.
NFTs: An array to hold all minted NFT objects.
- mintNFT(_name, _eyeColor, _shirtType, _bling): Mints a new NFT with the provided metadata and adds it to the NFTs array. Logs the name of the minted NFT.
- listNFTs(): Iterates through the NFTs array and prints the metadata of each NFT to the console.
- getTotalSupply(): Prints the total number of minted NFTs.
// Minting new NFTs
mintNFT("Himawari", "Blue", "Denim", "Gold earring");
mintNFT("Shinchan", "Green", "T-shirt", "Gold chain");
mintNFT("Doraemon", "Brown", "Shirt", "Gold ring");
mintNFT("Kazama", "Blue", "Shirt", "Gold chain");
// Listing all NFTs
listNFTs();
// Getting the total supply of NFTs
getTotalSupply();