I was just scrutinizing the source code of an NFT marketplace. within the createNFT( )
function of their smart contract, I witnessed there is a setApprovalForAll(_marketplaceAddress)
right after the _mint(msg.sender, _tokenId)
.
I perceive from this that even by minting a single ERC721 token, you are allowing the marketplace contract to have authority over all of your ERC721 tokens minted on that specific smart contact.
So my question is why they have not used approve()
(Not sure if it's the right approach), which is meant to approve the marketplace for just a single token rather than all of the tokens of the msg.sender
?
Thanks in advance
Is there a particular reason for such a approach?