Project: Create a NFT Collection
-
Create a variable that can hold a number of
NFT's
. What type of variable might this be? -
Create an object inside your
mintNFT
function that will hold the metadata for yourNFTs
. The metadata values will be passed to the function asparameters
. When theNFT
is ready, you will store it in the variable you created in step 1. -
Your
listNFTs()
function will print all yourNFTs
metadata to the console (i.econsole.log("Name: " + someNFT.name)
) -
For good measure,
getTotalSupply()
should return the number ofNFT's
you have created.
Here is a basic JS file to get you started:
Create a variable to hold your NFT's
// Code here
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(){
// Code here
}
Create a 'loop'
that will go through an 'array'
of NFT's
and print their metadata with console.log()
function listNFTs(){
// code here
}
Print the total number of NFTs
we have minted to the console
function getTotalSupply(){
// code here
}
Call your functions below
You can find the solution here.
I recommend you to learn the basics of Solidity in MetaCrafters or check out my notes on this repo, before attempting this assessment.
Author:
Twitter: @jfmartinz
Github: @jfmartinz
Linkedin: @jfmartinz