Skip to main content

NFT Drop

thirdweb's drop contracts lazy mint your NFTs and makes them available to be claimed by your users.

The NFT Drop contract is best used when you want to release a 1-of-1 or 1-of-many NFT collection, such as a PFP (profile picture) collection, and uses the ERC721 Standard. The NFT Drop contract allows you to define the conditions for when and how your users can mint an NFT, including allowlists, release dates, claim limits and delayed reveals.

When you add NFTs to your drop contract, they are not minted at this point. You prepare everything for your users so that they can mint the NFT(s). This means the user who claims the NFT is the one who mints it, and it is minted into their wallet. By default, the user is the one who pays the gas fees.

You could use the NFT Drop contract to:

  • Release a PFP Collection where each NFT has a different combination of traits
  • Release NFTs of your artwork, and have your community mint them for a price
  • Create a restricted-access NFT drop, where only a certain list of wallets can claim it

Create an NFT Drop Contract

Learn how to create any of thirdweb's pre-built contracts in the Deploying Contracts page.

Getting the contract in your application

To start using your NFT Drop contract inside your application, you'll need to use it's contract address. You can get the contract address from the dashboard.

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK("rinkeby");
const contract = sdk.getNFTDrop("{{contract_address}}");

Lazy Minting Your NFTs

Using the dashboard

You can batch upload NFTs through the dashboard by uploading a .csv file or a .json file that contains the metadata of all your NFTs, alongside the assets (images, videos, etc).

  • You must include a name column for each NFT in the .csv or json file
  • Asset file names must be sequential. E.g. 0.png, 1.png, 2.png.

You can use our examples to get started:

For a more in-depth guide on how to create your NFTs in the NFT Drop contract, check out our guide How to Release an NFT Drop.

Using the thirdweb SDK

// Custom metadata of the NFTs to create
const metadatas = [{
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}, {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"),
}];

const results = await contract.createBatch(metadatas); // uploads and creates the NFTs on chain
const firstTokenId = results[0].id; // token id of the first created NFT
const firstNFT = await results[0].data(); // (optional) fetch details of the first created NFT
View in Javascript SDK Documentation

Setting Claim Phases

A claim phase is a set of conditions that define when and how your users can mint an NFT.

You can have multiple claim phases that occur in sequence.

For each claim phase, you can define:

  • When the claim phase will start
  • How many NFTs you want to drop
  • How much you want to charge per NFT
  • What currency you want to use
  • Which wallet addreses are allowed to mint (allowlist)
  • How many NFTs can be claimed per transaction
  • How many seconds wallets have to wait between claims

Using the dashboard

For a more in-depth guide on how to set-up your NFT Drop with multiple claim phases and an allowlist, check out our guide Release an NFT Drop with an allowlist and multiple claim phases.

Using the thirdweb SDK

const presaleStartTime = new Date();
const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const claimConditions = [
{
startTime: presaleStartTime, // start the presale now
maxQuantity: 2, // limit how many mints for this presale
price: 0.01, // presale price
snapshot: ['0x...', '0x...'], // limit minting to only certain addresses
},
{
startTime: publicSaleStartTime, // 24h after presale, start public sale
price: 0.08, // public sale price
}
]);
await contract.claimConditions.set(claimConditions);
View in Javascript SDK Documentation

Delayed Reveals

Delayed reveals allow you to reveal the contents of the NFT to the user later at a specific date, and show a placeholder asset in the meantime.

Using the dashboard

  • Reveal upon mint: Collectors will immediately see the final NFT when they complete the minting.
  • Delayed Reveal: Collectors will mint your placeholder image, then you reveal at a later time.

Select Delayed Reveal

For a more in-depth guide on how to set-up your NFT Drop with delayed reveal, check out our guide Release an NFT drop with delayed reveal.

Using the thirdweb SDK

// the real NFTs, these will be encrypted until you reveal them
const realNFTs = [{
name: "Common NFT #1",
description: "Common NFT, one of many.",
image: fs.readFileSync("path/to/image.png"),
}, {
name: "Super Rare NFT #2",
description: "You got a Super Rare NFT!",
image: fs.readFileSync("path/to/image.png"),
}];
// 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.revealer.createDelayedRevealBatch(
placeholderNFT,
realNFTs,
"my secret password",
);
// Whenever you're ready, reveal your NFTs at any time
const batchId = 0; // the batch to reveal
await contract.revealer.reveal(batchId, "my secret password");
View in Javascript SDK Documentation

Setting Royalty Fees

Royalty fees are fees you earn on secondary sales of your NFTs. For example, if somebody mints an NFT from your drop and then sells it to another user, you will earn a royalty fee.

Using the dashboard

From the dashboard, in the Settings tab you can set the royalty percentage and the address that should receive the revenue from royalties earned from secondary sales of the assets.

Configuring Royalties on the Dashboard

Using the thirdweb SDK

// royalties on the whole contract
contract.royalty.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1%
fee_recipient: "0x..."
});
// override royalty for a particular token
contract.royalty.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 500, // 5%
fee_recipient: "0x..."
});
View in Javascript SDK Documentation

Minting / Claiming NFTs

With an NFT Drop contract, users claim NFTs by minting them into their wallet. Typically you will have a "mint" button that your users can click, which mints this user the next unclaimed NFT in your collection.

Using the embed

We have a pre-built embed that you can use to display your NFT Drop within your website.

You can access your NFT Drop's embed URL from the dashboard.

MFT Drop Dashboard Embed

Using the thirdweb SDK

const address = "{{wallet_address}}"; // address of the wallet you want to claim the NFTs
const quantity = 1; // how many unique NFTs you want to claim

const tx = await contract.claimTo(address, quantity);
const receipt = tx.receipt; // the transaction receipt
const claimedTokenId = tx.id; // the id of the NFT claimed
const claimedNFT = await tx.data(); // (optional) get the claimed NFT metadata
View in Javascript SDK Documentation

Viewing NFTs

Our SDKs provide helpful ways to view the NFTs in your collection.

One NFT

const tokenId = 0;
const nft = await contract.nft.get(tokenId);
View in Javascript SDK Documentation

All NFTs

const nfts = await contract.getAll();
console.log(nfts);
View in Javascript SDK Documentation

Claimed NFTs

const claimedNFTs = await contract.getAllClaimed();
const firstOwner = claimedNFTs[0].owner;
View in Javascript SDK Documentation

Unclaimed NFTs

const unclaimedNFTs = await contract.getAllUnclaimed();
const firstUnclaimedNFT = unclaimedNFTs[0].name;
View in Javascript SDK Documentation

NFTs owned by a specific wallet

// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
const nfts = await contract.getOwned(address);
console.log(nfts);
View in Javascript SDK Documentation

Viewing Supply

Claimed supply

const claimedNFTCount = await contract.totalClaimedSupply();
console.log(`NFTs claimed so far: ${claimedNFTCount}`);
View in Javascript SDK Documentation

Unclaimed supply

const unclaimedNFTCount = await contract.totalUnclaimedSupply();
console.log(`NFTs left to claim: ${unclaimedNFTCount}`);
View in Javascript SDK Documentation

Transferring NFTs

You can transfer NFTs from one wallet to another.

const walletAddress = "{{wallet_address}}";
const tokenId = 0;
await contract.nft.transfer(walletAddress, tokenId);
View in Javascript SDK Documentation

Burning NFTs

Burning is the process of removing the token from circulation by sending it to an inaccessible address. It does not delete the token from the blockchain.

Using the dashboard

Burning Claimed NFTs on Dashboard

Using the SDK

const result = await contract.burn(tokenId);
View in Javascript SDK Documentation