DAN
Website
  • 🚀Accelerating Digital Ownership Adoption
  • Digital Assets Network
    • ❌Challenges in Adoption
    • ✅DAN Stack
    • 📜Modular Protocol
    • 🎯DAN Labs Impact
    • 🔐®️ ERC-7066 Author
      • Overview
  • DAN PROTOCOLS
    • 📌Modular Solutions for Digital Ownership
    • 💡Asset Creation
    • 🤝Marketplace
    • 🔓Rent Protocol
    • 💰Loan Protocol
      • How does a loan work?
    • 💰Utility Protocol
      • How does it work?
  • For Developers
    • 🚀Launchpad
      • APIs
        • User's Collections
        • Collection Details
      • SDK
        • Create Collection
        • Mint NFT
        • Mint NFT (Batch)
    • 🛒Market
      • APIs
      • SDK
        • Create Listing
        • Buy Listed NFT
        • Cancel Listing
    • ⚙️Utility
      • APIs
        • 👥Client
          • Register
          • Verify
          • Redeem Code
          • Get All Claimed Utility User
        • 👨‍💻Developer
          • Get All Benefits By Collection
      • SDK
    • 💰Loans
      • APIs
        • User Loans
        • Raw Transactions (Advanced)
      • SDK
        • EVM
        • Solana
      • Wallet Integration
        • EVM
        • Solana
    • 🗞️Rentals
      • APIs
        • NFTs (Owned and Rented)
        • NFTs (Rented)
        • Raw Transactions (Advanced)
      • On-Chain
      • SDK
        • EVM
        • Solana
      • Wallet Integration
        • EVM
        • Solana
    • ⛓️Supported Chains
  • UseCases : Case Studies
    • 🤝NFT Rentals
    • 💎Ephemeral / Consumable NFTs
    • 📝NFT Mandates
    • 🎆Post-Mint Utility
    • 💼Partial Payment at Mint
  • Community
    • 🔑Terms of Service
    • 🔏Privacy Policy
    • 🌐Website
    • 👽Discord
    • 🐦Twitter
Powered by GitBook
On this page
  1. For Developers
  2. Launchpad
  3. SDK

Create Collection

Create Collection

The launchToken function from the Launchpad SDK is used to create collection of various types of tokens (ERC-721, ERC-1155, SoulBound, Certificate) on the blockchain. It handles public and private minting conditions based on the token type.


🔧 Function Signature

async function launchToken(
  tokenType,
  _name,
  _symbol,
  _maxSupply,
  price,
  _tokenURI,
  chainId,
  signer,
  contractAddress,
  env
)

📄 Parameters
  • tokenType (number): Specifies the type of token to deploy. Possible values:

    • TokenType.SoulBoundPrivate (0)

    • TokenType.ERC1155Public (1)

    • TokenType.ERC1155Private (2)

    • TokenType.ERC721Public (3)

    • TokenType.ERC721Private (4)

    • TokenType.Certificate (5)

  • _name (string): The name of the token/collection.

  • _symbol (string): The symbol of the token (e.g., ETH, MATIC).

  • _maxSupply (number | ethers.MaxUint256): Maximum token supply. Not needed for ERC 1155 as it will be set later for each NFTs.

  • price (number): Minting price for ERC 721 public tokens. Set to 0 for private tokens,ERC 1155(later will set for each NFTs) and certificates.

  • _tokenURI (string): URI for metadata, required only for Certificate tokens. Use an empty string for other types.

  • chainId (number): The chain ID of the network where the token is deployed.

  • signer (ethers.Signer): Ethers.js signer object for transaction signing.

  • contractAddress (string): The address of the deployed contract.

  • env (string): The environment to use (testnet or mainnet).

✅ Example Usage

1. SoulBound Private Token:

await launchToken(
  TokenType.SoulBoundPrivate,
  'MySoulBoundToken',
  'SBT',
  5000,
  0,
  '',
  1,  // Ethereum Mainnet
  signer,
  '0xContractAddress',
  undefined
);

2. ERC-1155 Public Token:

await launchToken(
  TokenType.ERC1155Public,
  'GameAssets',
  'GMA',
  0,
  0,
  '',
  137,  // Polygon Mainnet
  signer,
  '0xContractAddress',
  undefined
);

3. ERC-1155 Private Token:

await launchToken(
  TokenType.ERC1155Private,
  'PrivateAssets',
  'PVA',
  0,
  0,
  '',
  137,  // Polygon Mainnet
  signer,
  '0xContractAddress',
  undefined
);

4. ERC-721 Public Token:

await launchToken(
  TokenType.ERC721Public,
  'ArtGallery',
  'ART',
  1000, 
  ethers.utils.parseEther('0.1'), //in smallest unit of that currency
  '',
  1,  // Ethereum Mainnet
  signer,
  '0xContractAddress',
  undefined
);

5. ERC-721 Private Token:

await launchToken(
  TokenType.ERC721Private,
  'VIPArt',
  'VIP',
  200,
  0,
  '',
  1,  // Ethereum Mainnet
  signer,
  '0xContractAddress',
undefined
);

6. Certificate Token:

PreviousSDKNextMint NFT

Last updated 2 months ago

🚀