We would like to publish our collection on OpenSea, the artwork is done, and would like to do so using Haslips' smart contract. This smart contract already has a similar thing that we are looking for, but it reveals all NFTs.
https://github.com/HashLips/hashlips_nft_contract
What do I need to do if I want the image to be revealed every time the user buys one?
We have a great cover image that would show until the NFT is bought.
So the users on OpenSea would see the collection with this "not revealed" image, but when they buy one, the NFT is revealed.
I am also open for suggestions if this would not be feasible or would become too expensive or if it's not user/blockchain friendly.
Thank you for your help and suggestions
Best Answer
Inside SimpleNFT.sol, instead of the
bool public revealed
variable you could have amapping (uint256 => bool) revealed
.This maps each
tokenId
to a boolean value (it is false by default). This boolean value specifies whether the token identified bytokenId
is revealed or not.Then, inside the mint function we want to reveal tokens as they are minted:
Next we need to update the tokenURI function
Finally, remove the reveal function altogether.