0

Let's say, I wanted to create an NFT collection such that there'll be 3 classes/types of NFTs: animals, humans and aliens.

For this, will I then have to simply introduce a field for type in a contract and it'll be it?

How would then a type variable be passed to the constructor(...) or perhaps to mint(..) properly in this case?

How is it usually implemented in the case of NFT?


ERC1155 or ERC721

1 Answer 1

1

I'd say it depends.

This kind of things can either be at the contract level or in the metadata. Metadata is the data which is usually pointed at with an URI inside the contract, and the metadata contents depend on the NFT unique ID.

If the type is added at contract level, you probably have three different contracts: one for each type. So when minting an animal NFT you call the minting in the AnimalNFT.sol or whatever it's called.

You can also add it as a field inside the contract, but that kind of logic is not supported in external integrations. For example, if you want to sell the NFT in Opensea, I don't think they check if there is a type field since it's not part of the standard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.