I would like to be able to call all the addresses for a specific tokenId in an ERC1155 contract in order to airdrop those with a specific token. I know ERC721 has the function ownerof to allow for this, is there an equivalent for ERC1155?
There is no function for this on
Because a token is not necessarily unique, it can have multiple owners.
ERC20 there is no function to list all the holders.
_balances mapping is like this:
mapping(uint256 => mapping(address => uint256)) private _balances;
TokenID => holder => amountOfTokenID
TokenID you can have multiple holders
To answer your question: It is not possible to retrieve this information from the smart contract.
However, it is possible to get this information off-chain using
events with the right logic / filters
Or via TheGraph.