Im trying to track in real time the holders of any ERC1155 contract, and I have this doubt about this interface.
The ERC1155 can work as an NFT or as a Token, but also as both at the same time, right?
If it do, Is there any other way to know if a transaction involves NFTs or tokens as part of checking if the value of the transaction is 1 or not?
Thanks!
Edit 1: Reading the oficial specification of the ERC1155 I found the following:
The following strategies are examples of how you MAY mix fungible and non-fungible tokens together in the same contract. The standard does NOT mandate how an implementation must do this.
Also they propose a posible implementation of how to mix both uses cases:
The top 128 bits of the uint256 _id parameter in any ERC-1155 function MAY represent the base token ID, while the bottom 128 bits MAY represent the index of the non-fungible to make it unique.
uint256 baseTokenNFT = 12345 << 128;
uint128 indexNFT = 50;
uint256 baseTokenFT = 54321 << 128;
balanceOf(msg.sender, baseTokenNFT); // 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(msg.sender, baseTokenNFT + indexNFT); // 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(msg.sender, baseTokenFT); // Get balance of the fungible base token 54321.