Hi,
I have set up a Sync And Watch Contract Events with TransferSingle(address, address,address,uint256,uint256)
topic to get notified every time an NFT is sold sitting on specific smart contracts. Database gets populated every time an NFT is sold and then I do http post this data to my backend with the help of Moralis.Cloud.afterSave
and use it as needed. So far so good.
However, I need to differentiate whether an NFT is sold by the initial owner (i.e, by who minted them) or it just changed hands (sold from another buyer). I was looking what columns there are and how they might help me, and I noticed that column from
has 0x0000000000000000000000000000000000000000
for the sells from the initial owner (who minted them). So that got me wondering if thatβs a reliable way of doing what I want to do? Is the following pseudo code looks fine? If not, how can I achieve this?
if from == "0x0000000000000000000000000000000000000000"
// NFT is sold by the initial owner (minter)
else
// NFT has changed hands (sold from a buyer)