We will first demonstrate the NFT query with the Sappy Seals collection then we will do the same for the Pudgy Penguins collection

1- Sappy Seals

https://www.loom.com/share/dc0daaac799a4943a4691163991ad394?sid=45b3d22d-0dd0-4922-8943-ffe40b6731d8

Perform SELECT queries from Polygon zkEVM on the Sappy Seals NFT collection on Ethereum to see which NFTs an address owns over a specified block range.

  1. Go to our sample query client contract on polygonscan

  2. Click on “Connect to Web3” to connect your wallet.

  3. Expand the “queryNFT” section.

  4. Populate the following fields with these values:

  5. Populate “holder” with an address you’d like to query (eg. 0x1C70D0A86475CC707b48aA79F112857e7957274f ).

  6. Populate the “startBlock” and “endBlock” fields to identify the Ethereum mainnet block range you’d like to query over (eg. 20365188 to 20365288).

  7. Click the “Write” button to run the query.

If you are familiar with SQL, the query you send translates to this statement:

SELECT token_ids
FROM   sappy_seals
WHERE  owner = '0x1C70D0A86475CC707b48aA79F112857e7957274f'
       AND block >= 20365188
       AND block <= 20365288
LIMIT  5 OFFSET 5

Check the Result of the Query

Once you sign and broadcast the query tx, the Lagrange Proof Network will compute an off-chain proof that it submits on chain once ready.

  1. check the proof on the polygonscan explorer in contract events. Make sure the Method is respond.

Screenshot 2024-07-23 at 02.37.29.png

  1. Click on the Txn Hash and navigate to the Logs Tab. You should be able to see the token ids which correspond to the NFTs of the holder