ZKEdition
Last updated
Was this helpful?
Last updated
Was this helpful?
An extension of Frosty's gas-optimized which allows minting multiple NFTs for nearly the cost of one. ZKEditions enable people to collect NFTs while preserving their privacy. A primary reason that this is important is collectors are able to showcase their NFTs without revealing their wallet address or every other transaction they have executed. Oversharing transaction histories can becomne severe security issue but is remedied via ZKEditions where a wallet must submit a valid zk proof to call the contract's mint function. Implementations of ZKEdtitions that we find exciting include:
Private NFT auctions: the identities of participants and the amounts they have bid can be concealed. Think how useful this would have been to !
Brand sponsored NFTs: corporations might wish to use NFTs as loyalty programs, carrots to attract new customers, or means of tracking impressions. These are interesting use cases; however, these brands should not be able to querey wallet addresses to build detailed user profiles based on all of your financial transactions! ZKEditions accomplish the stated goal without the dubious externalities.
To begin we'll import the FrostySDK, chain configurations, and the ZKEdition module.
Then we'll setup our signer (via wagmi/ethers) and create a new instance of the FrostySDK.
Deploy a minimal proxy clone of the Edition implementation contract.
Get an ethers contract instance of a previously deployed Edition contract.
Deploy a minimal proxy clone of the Edition implementation contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
name (string) The name of the NFT collection.
symbol (string) The symbol of the NFT collection.
hasAdjustableCap (boolean) - optional
Include the ability to change maxTokens
at a date after deployment.
maxTokens (number) The total number of tokens allowed to be minted from the collection.
tokenPrice (BigNumber) The price (in Wei) to mint a token from the collection.
maxTokenPurchase (number) The maximum number of tokens allowed per mint.
merkleRoot (string) - optional Hash of allowlist updated to gate minting.
presaleStart (number) - optional Unix time presale goes live.
presaleEnd (number) - optional Unix time presale ends.
saleStart (number) - optional but recommended Unix time general sale starts. General sale applies to contracts deployed with and without an allowlist.
saleEnd (number) - optional but recommended Unix time general sale ends.
zkVerifier (string) zkProof enabling wallet to call the contract's mint function.
royaltyBPS (number) The maximum number of tokens allowed per mint.
metadataURI (string) The base URI for the collection metadata.
hasTokenGate (string) The address of an NFT contract from wich users must own a token to mint. Think of as a more dynamic allowlist or light anti-sybil mechanism.
metadataRendererInit (MetadataRendererInit) An object containing metadata to initialize with the on-chain metadata renderer.
onTxPending (Function) - optional A callback function executed upon submission of the deploy transaction.
onTxReceipt (Function) - optional A callback function executed upon receipt of the deploy transaction.
Get an ethers contract instance of a previously deployed Edition contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
address (string) The contract address of a previously deployed Edition contract.
Mints the specified number of tokens to msg.sender
numberOfTokens (uint256) The name of the NFT collection.
Toggles whether to allow minting.
Allows the owner to withdraw the contract balance.
Allows the owner to update the base URI for token metadata.
uri (uint256) The base URI serving metadata for the NFT collection.
parentIP (string) - optional Implementation of to assign token metadata to the address of another NFT with registered IP.
Mints the specified number of tokens to msg.sender.
Toggles whether to allow minting.
Allows the owner to withdraw the contract balance.
Allows the owner to update the base URI for token metadata.