axiom-crypto / autonomous-airdrop-example

Example dapp built with the Axiom SDK
https://autonomous-airdrop-example.vercel.app
12 stars 14 forks source link

how to check current nft ownership #7

Open pishty1 opened 8 months ago

pishty1 commented 8 months ago

Hello, apologies if this isnt the place for this question.

Im trying to modify the example so that it the airdrop happens only if an account (user) currently owns a particular nft. So far what i see from the docs, I have to specify block number as input which can be sometime in the past where the user previously owned NFT but not currently (at the time the user is claiming the airdrop). How can I check with certainty that a user (claiming the airdop) currently owns an NFT (and not just for a period of time in the past) ?

Many thanks.

nyunyunyunyu commented 8 months ago

In you smart contract, you can use ownerOf in the NFT contract to check the current owner of a NFT.

pishty1 commented 8 months ago

right thank you, does this mean that if i have some logic for the airdrop rules that checks against current data and historic data then i would put the current data checks in .sol and historic data checks in .circuit ?