Recognising NFT's whether they are sold by the minter or from another buyer?


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)
  // NFT has changed hands (sold from a buyer)

Does the contract have an solidity function to sell NFT / buy? If yes, then u can use also also sync and watch that particular function and verify the latest seller and buyer address.

In another way you can verify the ownership by getContractNFTTransfers web3API function.

example function:

const options = {
  address: "0x7de3085b3190b3a787822ee16f23be010f5f8686",
  chain: "eth",
const nftTransfers = await Moralis.Web3API.token.getContractNFTTransfers(

Result example:

    block_number: "14238158",
    block_timestamp: "2022-02-19T18:49:02.000Z",
    transaction_index: 162,
    log_index: 419,
    value: "0",
    contract_type: "ERC721",
    transaction_type: "Single",
    token_address: "0x7de3085b3190b3a787822ee16f23be010f5f8686",
    token_id: "1",
    from_address: "0x0000000000000000000000000000000000000000",
    to_address: "0x324fb4a58674758e00c3a49409b815de1398bfe8",
    amount: "1",
    verified: 1,
    operator: null,

you could parse all the transactions to see if that transfer from address 0 happened for that particular nft and address combination, you should see that transfer from address 0 when the nft is minted and not when it is sold