ERC721Revealable
Encrypt the metadata of your NFTs until you reveal them by implementing ERC721A
, LazyMint
, and DelayedReveal
.
Base Contracts Implementing This Feature
Unlocked Features
By implementing ERC721Claimable
, you unlock the following features in the SDK and dashboard:
SDK Usage | Description |
---|---|
Delayed Reveals | Pass in an array of NFT metadata to encrypt it and reveal it at a later time. |
Implementing It Yourself
This section is meant for advanced users who want to write the functionality from scratch.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/eip/ERC721A.sol";
import "@thirdweb-dev/contracts/extension/LazyMint.sol";
import "@thirdweb-dev/contracts/extension/DelayedReveal.sol";
contract Contract is ERC721A, LazyMint, DelayedReveal {
constructor(
string memory _name,
string memory _symbol
)
ERC721A(
_name,
_symbol
)
{}
function _canLazyMint() internal view override returns (bool) {
// Your custom implementation here
}
function mintDelayedRevealNFT(
address to,
string memory beforeRevealURI,
bytes memory encryptedPostRevealURI
) public {
// Your custom implementation here
}
function reveal(uint256 tokenId, bytes calldata key)
external
override
returns (string memory revealedURI)
{
// Your custom implementation here
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
// Your custom implementation here
}
}