How to snapshot NFT Holder on zkSync Era? #109
-
EnvironmentMainnet Provide a brief description of the functionality you're trying to implement.Im a creator of NFT on zkSync Era, and i would love to know how to snapshot NFT Holder. What is the specific issue or error you're encountering?Im trying to get the list of the Holder wallet address of my NFTs project Can you share the error messages or logs you're receiving, if any?No Have you made any recent changes to the contract before encountering this issue?No Are there any external libraries or contracts that your contract interacts with?zkSync Era Can you provide the relevant portions of your contract code where the issue is occurring?Np Have you tried to isolate the problem, and if so, what were the results?Error What steps have you already taken to try to resolve the issue?I try to use javascript but its still shows error Repo Link (Optional)No response Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Can you please share the JavaScript code you are getting the error? Listing holders on Era would be the same as in any other EVM chain. |
Beta Was this translation helpful? Give feedback.
-
You can get the NFTs owned by an account by calling the optional standard method: Also, closing this discussion as it is stale for one week. |
Beta Was this translation helpful? Give feedback.
You can get the NFTs owned by an account by calling the optional standard method:
tokenOfOwnerByIndex
. If the method is not implemented I would look at the most recent mint transaction for the NFT contract, use the ID as a max value and loop from 0 calling theownerOf(tokenId)
method of the contract seeing if it matches your account address of interest.Also, closing this discussion as it is stale for one week.