I have created an NFT market, based on multiple tutorials I found on the internet. Most follow the same approach: 1 smart contract for the market, and 1 for the NFT that extends the ERC721URIStorage from the openzeppelin library. But when a new token is minted and listed on the market (or when the token is sold), both contracts need to be executed :

  • NFT mint on the NFT contract ( or setApprovalForAll for changing owner later)
  • meta information updated on the NFTMarket contract

My feeling is that this architecture is pretty inappropriate: if for any reason, only the first smart contract is executed, the NFT smart contract will be updated, but data won't be reflected on the NFT market. So the question is: do you know if a better flow exists?

Code available here (lines 52 and 58) https://github.com/canujohann/NFT-marketplace/blob/master/pages/details/%5Bid%5D.js#L52

If no clear, let me know.


Your Answer

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

Browse other questions tagged or ask your own question.