In Openzeppelin, how does ERC-1155 NFT id been defined as the standard does not mandate how an implementation must do this.
Shall I follow the split ID bits mentioned by EIP?
uint256 baseTokenNFT = 12345 << 128;
uint128 indexNFT = 50;
uint256 baseTokenFT = 54321 << 128;
balanceOf(baseTokenNFT, msg.sender); // Get balance of the base token for non-fungible set 12345 (this MAY be used to get balance of the user for all of this token set if the implementation wishes as a convenience).
balanceOf(baseTokenNFT + indexNFT, msg.sender); // Get balance of the token at index 50 for non-fungible set 12345 (should be 1 if user owns the individual non-fungible token or 0 if they do not).
balanceOf(baseTokenFT, msg.sender); // Get balance of the fungible base token 54321.
It really depends on your use case and how you want to implement it.
I haven’t experimented with the split ID approach.
In the simple examples I have experimented with I have used:
A fungible token in ERC1155 has a quantity greater than one.
A non-fungible token in ERC1155 has a quantity of one.
If you want a fungible token, mint multiples of them. In the example below Silver, Gold, Silver, Swords and Shields are fungible, whilst Thors Hammer (as only one is minted) would be non-fungible.
Hi, Anup
If you minted Thors Hammer as a non-fungible token [quantity = 1], I don't think there's a way to change it to a fungible token, let alone one with the same Id.
One thing you can do is fractionalize the same NFT by wrapping it up with an ERC20 token. But that's a different domain and not the answer you're seeking for in my guess.