Skip to main content

Create an NFT Collection Using LSP7

This tutorial explores how to create a collection of digital assets, where each digital asset is the same. This method is useful for minting large quantities of NFTs at once efficiently (eg: tickets for an event).


This guide builds on top of a Hardhat project using TypeScript as described in the Getting Started section.


The full code of this example can be found in the smart contract section of the ðŸ‘ū lukso-playground repository.


To create your custom contract based on the LUKSO smart contracts, you will need the @lukso/lsp-smart-contracts library. Go ahead and add it to your project:

npm install @lukso/lsp-smart-contracts

Create the Smart Contracts​

When creating smart contracts representing digital assets on LUKSO, you will need to specify the token type and data keys for the 📄 LSP4 Digital Asset Metadata that will be stored in the 🗂ïļ ERC725Y storage of the Digital Asset. There are three different token types:

  • 0 = Token
  • 1 = NFT
  • 2 = Collection

For this example we will use the Token token type. You can create a custom 🌄 LSP7 Digital Asset Token that extends LSP7Mintable so that new assets can be minted by the owner of the smart contract.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

// modules
import {
} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol";
import {
} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";

contract EventTicketsNFT is LSP7Mintable {
string memory eventName,
string memory tokenSymbol,
address contractOwner
_LSP4_TOKEN_TYPE_TOKEN, // set the token type as Token
true // make the token non divisible

Next you define the deployment script.

import { ethers } from "hardhat";

// typechain should generate new types for you on every compilation
// otherwise you can always: npx hardhat typechain
import {
} from "../typechain-types";

async function deployAndCreateTickets() {
const accounts = await ethers.getSigners();
const deployer = accounts[0];

const luksoMeetupTickets: EventTicketsNFT = await new EventTicketsNFT__factory(
"LUKSO Meetup #2",

// create 100 entry tickets.
// Give them to the deployer initially, who will distribute them afterwards.
deployer.address, // recipient
100, // amount
true, // force sending to an EOA
"0x" // data
const luksoMeetupTicketsAddress = await luksoMeetupTickets.getAddress()
console.log("NFT Collection deployed to:", luksoMeetupTicketsAddress)
console.log("Check the block explorer to see the deployed contract")


deployAndCreateTickets().catch((error) => {
process.exitCode = 1;

Check Your NFT Collection​

You can now check out your NFT collection on the execution block explorer using the address output to the web console during deployment.