-1

I'm facing a challenge with my NFT marketplace project. How I can create NFTs with the rule that those NFTs can only be sold on our own platform but others. Technically is possible, however, I need some help here.

Thank you.

David
  • 607
  • 1
  • 6
  • 19

1 Answers1

1

Yes this possible For that you have to maintain a mapping or some sort of logic on smart contract level to keep track of whether to and from address belong to your ERC 721 contract or not.

transferFrom(from, to, tokenId)

Like when someone mints NFT on your smart contract you can save the address of the minter. And at the time of selling of you can have a condition at the start of transferFrom like.

require(to == exists[to], "Warning, You are selling outside of the contract")

mapping can be something of like this. mapping(address => address) exists;

Shamoon97
  • 332
  • 2
  • 12
  • Thank you for sharing your solution here. Would you mind providing more detailed information such as an example of Solidity if possible? If I understood you correctly, the logic behind is to leverage the transferFrom function to check whether or not the "to" address is our marketplace customer. Is that right? Otherwise, I would appreciate if you could elaborate more. Thank you – David Jul 02 '22 at 10:31