ERC721 – Smart Contract Transfer Tokens as the Contract Owners

erc-721

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.

Best Answer

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.

Related Topic