0

I would like to adapt my current contract to include a post mint image/metadata reveal feature. i.e. after an NFT is minted I would only then like the image/metadata to be revealed for that particular NFT.

Here is my sad attempt.

https://github.com/PALICADE/test/blob/main/exampleContract.sol

Any help or suggestions you can provide would be great.

2 Answers 2

0

I'm not sure you need to do anything at all.

Your tokenURI function already starts with

 require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

If the token doesn't exist then the function will revert all by itself.

1
  • The problem with this is if all the files are already uploaded to IPFS, someone could snipe the rares once they know the base URI since most follow the format baseURI/tokenID, so once tokenID 1 is revealed and the URI format is known, you could see any tokens metadata. This article explains some solutions for that: medium.com/web-design-web-developer-magazine/…
    – luxo
    May 10, 2022 at 10:10
0

There is no way to hide a reveal on the blockchain because your transaction is public. Here are the solutions I see:

  • Make a centralised backend that does the reveal, with the baseURI pointing to the backend
  • Host 'hidden' images with the baseURI leading to them and change the baseURI when needed at reveal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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