through, if tokenid and tokenaddress and issold = false of the contract and id parsed in, then throw an error. Am i missing something?
If I understand your use case...it seems like your require logic should perhaps be: require((nftsForSale[i].token != tokenAddress || nftsForSale[i].tokenID != tokenID || nftsForSale[i].isSold == true), "NFT already listed");
That's using an OR condition. It needs to match all conditions, thats why i used AND
AND seems incorrect. Imagine trying to list a new tokenId for sale from the same collection as one already listed for sale. You'll notice that it will fail because your code is requiring the tokenID to be different AND the collection to be different. Doesn't make sense.
Обсуждают сегодня