Perform SELECT queries from Base on the Pudgy Penguins 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 Basescan
  2. Click on “Connect to Web3” to connect your wallet.
  3. Expand the “query” section.
  4. Populate the following fields with these values:
  5. Populate “holder” with an address you’d like to query (eg. 0x29469395eAf6f95920E59F858042f0e28D98a20B for the Blur NFT marketplace).
  6. Populate the “startBlock” and “endBlock” fields to identify the Ethereum mainnet block range you’d like to query over (eg. 19774897 to 19774997).
  7. Click the “Write” button to run the query.

Screenshot 2024-05-03 at 10.55.28.png

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

SELECT token_ids
FROM   pudgy_penguins
WHERE  owner = '0x29469395eAf6f95920E59F858042f0e28D98a20B'
       AND block >= 19774897
       AND block <= 19774997
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 basescan explorer in contract events. Make sure the Method is respond.

Screenshot 2024-05-03 at 11.26.54.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

Screenshot 2024-05-03 at 11.32.29.png

  1. Go to the pudgypenguins Collection on Opensea
  2. Check the owner of one of the NFT results by searching by the token id , then click on the NFT.

Screenshot 2024-05-03 at 11.40.06.png

Screenshot 2024-05-03 at 11.42.02.png

Account ID of the Owner

  1. The address of the Holder should ****correspond to the address you have specified in the query

    Screenshot 2024-05-03 at 11.42.40.png


Congratulations 🎉 you have made a query that fetches proved historic data on-chain!