1

This is the hypothetic use case I came up to learn about smart contract programming.

I am trying to create a ERC721 Smart Contract that would mint tokens for photographers who want to sell their work. The photographer uploads a picture and I put it somewhere and include that link as the tokenURI for my UniquePhotoNFT.

When I mint a new token of UniquePhotoNFT, it has an ID (1,2,3,4, etc) with all different token URIs. All those tokens belong to me as I am holding all those tokens for my users (so they don't need to deal with any of the blockchain staff).

When someone comes to buy a UniquePhotoNFT with token id 3, I can easily transfer that token 3 to the buyer's address. However, if the new owner decides to sell the same token to someone else, how can I make the transfer on their behalf? It won't let me do it because as the contract owner, I am not the token owner.

2 Answers 2

2

The EIP-721 provides a function isApprovedForAll(address owner, address operator)

Query if an address is an authorized operator for another address

That function can be used enable a special address to always be authorized to operate on the NFTs.

0

You can create a marketplace contract. Seller should approve this token to your marketplace. If you verified your marketplace contract, that won't be a problem. Because contract addresses don't have private key. Here is the steps:

  1. Seller approve token to marketplace.
  2. Seller calls setForSale function from marketplace.
  3. Buyer can come and buy tokens from market (don't forget to check getApproved).
2
  • What would be a good example of marketplace contract? Oct 16, 2021 at 4:25
  • You can look rarible or opensea's contracts. I recommend you to look Rarible's docs. Oct 16, 2021 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.