Skip to main content

Edition

thirdweb's Edition contract is a n-of-1 or n-of-many NFT Collection, that follows the ERC1155 Standard also known as "Semi-Fungible Tokens".

The Edition contract is best used when you want to release many NFTs based on the same asset, but you don't want to "drop" or "release" them for your community to claim.

Unlike the Edition Drop contract, the Edition contract does not lazy mint your NFTs. Instead, NFTs are minted immediately when they are added to the collection.

This means you can still transfer the NFTs or sell them on a Marketplace, and perform any other actions you would expect to do with a NFT.

You could use the Edition contract to:

  • Create an NFT Collection where each NFT has 100 copies
  • Airdrop a list of wallet addresses an NFT that all use the same asset and metadata
  • Create 10 "copies" of your artwork and sell them on a Marketplace

Create an Edition 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 Edition 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.getEdition("{{contract_address}}");

Setting Royalty Fees

Royalty fees are fees you earn on secondary sales of your NFTs. For example, if you sell an NFT on the marketplace, and it is then sold again 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 NFTs

With an Edition contract, you choose which wallet addresses are able to mint NFTs into your collection.

By default, only you (the smart contract owner) are able to mint NFTs into the collection.

You can specify which wallets can mint in the Permissions tab of your NFT Collection, under the Creator section.

Configuring Royalties on the Dashboard

For more advanced use-cases, such as creating a community-made collection, you can use signature-based minting.

Using the dashboard

For a more in-depth guide on how to create an NFT Collection, check out our guide here Creating an Edition.

Using the thirdweb SDK

Mint One NFT

// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"

// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
const metadata = {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}

const metadataWithSupply = {
metadata,
supply: 1000, // The number of this NFT you want to mint
}

const tx = await contract.mintTo(toAddress, metadataWithSupply);
const receipt = tx.receipt; // the transaction receipt
const tokenId = tx.id; // the id of the NFT minted
const nft = await tx.data(); // (optional) fetch details of minted NFT
View in Javascript SDK Documentation

Mint Many NFTs (Batch Mint)

// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"

// Custom metadata and supplies of your NFTs
const metadataWithSupply = [{
supply: 50, // The number of this NFT you want to mint
metadata: {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}, {
supply: 100,
metadata: {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}];

const tx = await contract.mintBatchTo(toAddress, metadataWithSupply);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
View in Javascript SDK Documentation

Mint One NFT

// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"

// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
const metadata = {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}

const metadataWithSupply = {
metadata,
supply: 1000, // The number of this NFT you want to mint
}

const tx = await contract.mintTo(toAddress, metadataWithSupply);
const receipt = tx.receipt; // the transaction receipt
const tokenId = tx.id; // the id of the NFT minted
const nft = await tx.data(); // (optional) fetch details of minted NFT
View in Javascript SDK Documentation

Mint Many NFTs (Batch Mint)

// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"

// Custom metadata and supplies of your NFTs
const metadataWithSupply = [{
supply: 50, // The number of this NFT you want to mint
metadata: {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}, {
supply: 100,
metadata: {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}];

const tx = await contract.mintBatchTo(toAddress, metadataWithSupply);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
View in Javascript SDK Documentation

Airdrop NFTs

Airdropping means you send a wallet or a list of wallets a configurable quantity of your NFT.

Using the dashboard

Using the thirdweb dashboard, you can upload a .csv file containing a list of addresses you want to airdrop NFTs to.

You can download our example .csv file for airdrops here.

In the csv file you must specify an address column and a quantity column; representing the address you want to send the NFTs to, and how many you wish to send.

Using the thirdweb SDK

// Array of objects of addresses and quantities to airdrop NFTs to
const addresses = [
{
address: "0x...",
quantity: 2,
},
{
address: "0x...",
quantity: 3,
},
];
const tokenId = "0";
await contract.airdrop(addresses, tokenId);

// You can also pass an array of addresses, it will airdrop 1 NFT per address
const addresses = [
"0x...", "0x...", "0x...",
]
const tokenId = "0";
await contract.airdrop(addresses, tokenId);
View in Javascript SDK Documentation

Viewing NFTs

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

One NFT

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

All NFTs

const nfts = await contract.getAll();
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);
View in Javascript SDK Documentation

Amount of tokens owned by a specific wallet

// Address of the wallet to check NFT balance
const walletAddress = "{{wallet_address}}";
const tokenId = 0; // Id of the NFT to check
const balance = await contract.balanceOf(walletAddress, tokenId);
View in Javascript SDK Documentation

Transferring NFTs

Transferring NFTs means you can send this NFT to another wallet. You must be the owner of the NFT you're trying to transfer in order for this to be successful.

// Address of the wallet you want to send the NFT to
const toAddress = "{{wallet_address}}";
const tokenId = "0"; // The token ID of the NFT you want to send
const amount = 3; // How many copies of the NFTs to transfer
await contract.transfer(toAddress, tokenId, amount);
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, amount);
View in Javascript SDK Documentation