# VaultBackedNFT

This module simplifies the process of launching a Vault-Backed NFT into a single transaction, allowing you to deploy either an Edition or Rentable which will be automatically backed by a shared Vault.

[**Getting Started**](#getting-started)\
[**Module Methods**](#module-methods)

## Getting Started

To begin we'll import the FrostySDK, chain configurations, and VaultBackedNFT module.

Then we'll setup our signer (via wagmi/ethers) and create a new instance of the FrostySDK.

```
// Import SDK, chain configurations, and the VaultBackedNFT module
import { FrostySDK, chain, vaultBackedNFT } from "frosty-sdk";

// Get the signer via wagmi or configure using ethers
// Setup the SDK with the desired chain and signer
const sdk = new FrostySDK(chain.goerli, signer);
```

## Module Methods

[**create**](#create)\
Creates deployments of minimal proxy clones of the Vault as well as Edition or Rentable implementation contracts.

## create

Creates deployments of minimal proxy clones of the Vault as well as Edition or Rentable implementation contracts.

```
const [myNFT, myVault] = await edition.deploy(
  sdk,
  name,
  symbol,
  maxTokens,
  tokenPrice,
  maxTokenPurchase,
  royaltyBPS,
  metadataURI,
  metadataRendererInit,
  vaultDistributionTokenAddress,
  unlockDate,
  supports4907,
  onTxPending,
  onTxReceipt
);

console.log("NFT deployed to: ", myNFT.address);
console.log("Vault deployed to: ", myVault.address);
```

**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.

**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.

**royaltyBPS** (*number*)\
The maximum number of tokens allowed per mint.

**metadataURI** (*string*)\
The base URI for the collection metadata.

**metadataRendererInit** (*MetadataRendererInit*)\
An object containing metadata to initialize with the on-chain metadata renderer.

**vaultDistributionTokenAddress** (string)\
The address of the ERC20 token that will be distributed by the vault.

**unlockDate** (*number*)\
The timestamp at which the vault will unlock and allow distributions.

**supports4907** (*boolean*)\
A flag indicating whether to deploy a Rentable (true) or Edition (false) as the underlying NFT.

**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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frostyart.gitbook.io/frosty/for-developers/nft-utility-mechanisms-and-release/vaultbackednft.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
