ERC1155 Enumerable tokens under each tokenId

Hello, for an ERC1155 contract, each tokenId can have 1 minted token or many minted tokens under it, but how do I uniquely identify each token that was minted under the tokenId?

I see at the end of the mint operation, there is a bytes data option, and I'm wondering if this is how to give each minted token under the token Id a unique identifier - OpenZeppelin ERC1155

If I can set the bytes data of each minted token under the tokenId, how do I get the bytes data of each token under that tokenId? This would then allow me to map attributes to each token that was minted under each tokenId.

For example (psuedocode):

NFT-like tokens (need identifiers) = tokenId1 -> [token1, token2, token3, token4]
ERC20-like tokens (don't need identifiers) = tokenId2 -> [1,000,000 tokens]

Instead of just tokenId1 -> [(abstractly existing token only identifiable by balanceOf(account,tokenId1)), (abstractly existing token only identifiable by balanceOf(account,tokenId1)), (abstractly existing token only identifiable by balanceOf(account,tokenId1)), (abstractly existing token only identifiable by balanceOf(account,tokenId1))]

Hello @zerocool

For any question regarding a token standard, like ERC1155, I strongly encourage you start by reading the specifications.

The bytes data at end of the mint function is for callbacks to the recipient of the tokens. See the relevant part of the standard.

You might not like the answer, but if you want to build NFTs using ERC1155, you should mint only one instance per tokenId. If you mint multiple version with the same id, they are all fungible (just like ERC20s) and there is no way to uniquely identify them (they have the same identifier).

Hi Amxx, thanks for the response.

There should definitely be a model created for multiple tokens to be under a tokenId, which would allow for an NFT fractionalization system, where each fraction can have a specific value of the overhead tokenId. It's too bad 1155 doesn't allow for this.

Hopefully it will exist in the future.