ERC721Revealable
Functionality available for contracts that implement the
IERC721
and
ILazyMint
interfaces and inherit the
DelayedReveal
contract.
Allows you to lazy-mint batches of NFTs that are encrypted until a later time, and reveal them at any time using a password.
createDelayedRevealBatch
Create a batch of encrypted NFTs that can be revealed at a later time.
Provide an array of metadata for the NFTs you want to create, which can either be a
string
URL that points to metadata, or an object.
The metadata must conform to the metadata standards.
If you provide an object, it is uploaded and pinned to IPFS before being lazy-minted into the contract.
// the real NFTs, these will be encrypted until you reveal them
const realNFTs = [
{
name: "Cool NFT #1",
description: "This is a cool NFT",
image: "https://example.com/image.png", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
{
name: "Cool NFT #2",
description: "This is a cool NFT",
image: "https://example.com/image.png", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
];
// A placeholder NFT that people will get immediately in their wallet, and will be converted to the real NFT at reveal time
const placeholderNFT = {
name: "Hidden NFT",
description: "Will be revealed next week!",
};
// Create and encrypt the NFTs
await contract.erc721.revealer.createDelayedRevealBatch(
placeholderNFT,
realNFTs,
"my secret password",
);
Configuration
getBatchesToReveal
Get a list of unrevealed batches.
const batches = await contract.erc721.revealer.getBatchesToReveal();
Configuration
reveal
Reveal a batch of NFTs that were previously created with
createDelayedRevealBatch
.
const batchId = 0; // the batch to reveal
await contract.erc721.revealer.reveal(batchId, "my secret password");