ERC721OwnerOfBatchExample.cs 659 B

12345678910111213141516171819
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using Web3Unity.Scripts.Library.ETHEREUEM.EIP;
  4. public class ERC721OwnerOfBatchExample : MonoBehaviour
  5. {
  6. async void Start()
  7. {
  8. string contract = "0x47381c5c948254e6e0E324F1AA54b7B24104D92D";
  9. string[] tokenIds = { "33", "29" };
  10. string multicall = "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e"; // optional: multicall contract https://github.com/makerdao/multicall
  11. List<string> batchOwners = await ERC721.OwnerOfBatch(contract, tokenIds, multicall);
  12. foreach (string owner in batchOwners)
  13. {
  14. print("OwnerOfBatch: " + owner);
  15. }
  16. }
  17. }