From 090e7bd3e6a51570fb19db95507b71cd36d553e7 Mon Sep 17 00:00:00 2001 From: SOURAV GHOSH <153526688+SOURAVGHOSH123@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:51:30 +0530 Subject: [PATCH 1/2] Create Create_NFT_Collection.js --- Create_NFT_Collection.js | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Create_NFT_Collection.js diff --git a/Create_NFT_Collection.js b/Create_NFT_Collection.js new file mode 100644 index 0000000..998eaee --- /dev/null +++ b/Create_NFT_Collection.js @@ -0,0 +1,46 @@ +/* +Assessment Requirements +1. Create a variable that can hold a number of NFT's. What type of variable might this be? +2. Create an object inside your mintNFT function that will hold the metadata for your NFTs. + The metadata values will be passed to the function as parameters. When the NFT is ready, + you will store it in the variable you created in step 1 +3. Your listNFTs() function will print all of your NFTs metadata to the console (i.e. console.log("Name: " + someNFT.name)) +4. For good measure, getTotalSupply() should return the number of NFT's you have created +*/ + +// create a variable to hold your NFT's +const NFTs = []; +// this function will take in some values as parameters, create an +// NFT object using the parameters passed to it for its metadata, +// and store it in the variable above. +function mintNFT (_name,_eyecolor,_shirttype,_bling) { + const NFT= { + "name" : _name, + "eyecolor": _eyecolor, + "shirttype": _shirttype, + "bling": _bling + } + NFTs.push(NFT); + console.log("Name: " + _name); +} + +// create a "loop" that will go through an "array" of NFT's +// and print their metadata with console.log() +function listNFTs () { + for (let i = 0; i < NFTs.length; i++) { + console.log(NFTs[i]); + console.log(NFTs[i]); + console.log(NFTs[i]); + console.log(NFTs[i]); + } +} + +// print the total number of NFTs we have minted to the console +function getTotalSupply() { + console.log(NFTs.length); +} + +// call your functions below this line +mintNFT("sourav","blue","normal","gold chain") +listNFTs() +getTotalSupply() From de71af4064fa2fafdeb455eb745a180770a0d030 Mon Sep 17 00:00:00 2001 From: SOURAV GHOSH <153526688+SOURAVGHOSH123@users.noreply.github.com> Date: Sun, 2 Jun 2024 01:09:36 +0530 Subject: [PATCH 2/2] Delete Create_NFT_Collection.js --- Create_NFT_Collection.js | 46 ---------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Create_NFT_Collection.js diff --git a/Create_NFT_Collection.js b/Create_NFT_Collection.js deleted file mode 100644 index 998eaee..0000000 --- a/Create_NFT_Collection.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -Assessment Requirements -1. Create a variable that can hold a number of NFT's. What type of variable might this be? -2. Create an object inside your mintNFT function that will hold the metadata for your NFTs. - The metadata values will be passed to the function as parameters. When the NFT is ready, - you will store it in the variable you created in step 1 -3. Your listNFTs() function will print all of your NFTs metadata to the console (i.e. console.log("Name: " + someNFT.name)) -4. For good measure, getTotalSupply() should return the number of NFT's you have created -*/ - -// create a variable to hold your NFT's -const NFTs = []; -// this function will take in some values as parameters, create an -// NFT object using the parameters passed to it for its metadata, -// and store it in the variable above. -function mintNFT (_name,_eyecolor,_shirttype,_bling) { - const NFT= { - "name" : _name, - "eyecolor": _eyecolor, - "shirttype": _shirttype, - "bling": _bling - } - NFTs.push(NFT); - console.log("Name: " + _name); -} - -// create a "loop" that will go through an "array" of NFT's -// and print their metadata with console.log() -function listNFTs () { - for (let i = 0; i < NFTs.length; i++) { - console.log(NFTs[i]); - console.log(NFTs[i]); - console.log(NFTs[i]); - console.log(NFTs[i]); - } -} - -// print the total number of NFTs we have minted to the console -function getTotalSupply() { - console.log(NFTs.length); -} - -// call your functions below this line -mintNFT("sourav","blue","normal","gold chain") -listNFTs() -getTotalSupply()