0

let's take cryptokitties for example, if i were to create something similar in ERC721, i would create a smart contract named cryptokitties and a mint function that increases the token id each time a cryptokittie is minted. how do i do this in ERC1155?

i only know that in order to represent an nft you pass the value of 1 which means its an nft, and if you pass value more then 1 it means it fungible, i dont know how many cryptokitties are going to be created therefore i cant pass any value to the mint function.

3 Answers 3

1

what you can do is have a mapping that tracks which NFT belongs to like this:

mapping(uint256=> string) public nftsCollections;
//whenever you mint an nft require the admin to pass the collection name and  //add it to this collection
nftsCollections[id]=collectionName;
0

Every cryptokittie is an nft of its own. You shouldn't do it in ERC1155. Every time a cryptokittie is created you mint a new nft token, you don't add to the token already existed. If you use ERC1155 you enable the option to own more than one instance of the nft which denies the whole purpose of it.

0

The choice to use ERC 721 or ERC 1155 solely depends on your use case. ERC 1155 is a kind of extension to ERC 721, as it can create fungible as well as non-fungible tokens. So, if you want to stick your smart contract to mint true NFTs only, then ERC 721 is a good choice, but if you are unsure at this stage then you can deploy ERC 1155, and keep passing 1 as supply parameter in mint function to mint only 1 non-fungible token.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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