Capsule Docs
  • Introduction
  • Protocol Overview
    • Packaging and Shipping
      • Capsule Redemption Page
      • Capsule Relay
      • Example Integration
    • Use Cases
      • Compromised Address
      • Gasless Pickup
      • Gate Shipments
      • Time Locking Shipments
      • Walletless Pickup
      • Whitelisted Shipment
      • Wrong Address
    • Future
      • Capsule Invoice
      • Capsule Network
      • Lightning Bridging
    • Developer Walkthroughs
      • PostOffice.sol
      • Code Examples
        • Conditional Redemption
        • Conditional Shipment
        • Shipment POAPs
        • Whitelisted Redemption
  • Collaboration
    • Advertising
    • Partnership
  • Economics
    • Fee Structure
  • CapsuleNFT
    • Overview
      • Types of Capsule NFTs
      • Capsule Collections
        • Metamaster
        • Lockability
        • Private/Public
        • Collection Examples
        • Official Capsule Collections
    • Developer Walkthroughs
      • Developer Overview
      • Contracts
        • Capsule.sol
        • CapsuleFactory.sol
        • CapsuleMinter.sol
        • Testnets
          • Ethereum - Goerli
      • Developer - Mint a Capsule NFT
      • Developer - Redeem a Capsule NFT
      • Developer - Create a Capsule Collection
      • Developer - Managing a Capsule Collection
    • Use Cases
      • For Artists
      • For DeFi
      • For Gaming
    • Examples
      • Dollar Store Kids
    • Comparison to ERC-998
  • Additional Resources
    • FAQ
    • Official Links
    • Brand Kit
    • Legal
      • Terms of Use
      • Privacy Policy
      • Cookie Policy
      • CCPA Notice
      • Risks
    • Security
  • Send Feedback
    • Report a Bug
    • Contact Us
Powered by GitBook
On this page
  • Methodology
  • Example Capsule Collection Creation Call
  1. CapsuleNFT
  2. Developer Walkthroughs

Developer - Create a Capsule Collection

PreviousDeveloper - Redeem a Capsule NFTNextDeveloper - Managing a Capsule Collection

Last updated 1 year ago

Capsule Collections are NFT collections which support the minting of Capsule NFTs. You can mint any number of Simple Capsule NFTs, ERC-20 Capsule NFTs, ERC-721 Capsule NFTs, or ERC-1155 Capsule NFTs from a Capsule Collection you create.

Below is an example of creating your own Capsule Collection.

Methodology

In order to create a Capsule Collection, only one method needs to be called - createCapsuleCollection.

The docs for the method (also found under ) are posted here for reference:

function createCapsuleCollection(string _name, string _symbol, address _tokenURIOwner, bool _isCollectionPrivate) external payable returns (address)

Usage: The main method which creates a Capsule NFT Collection for a user. Creation of a Capsule Collection MUST go through the CapsuleFactory in order to ensure ecosystem safety - this ensures that no Capsule contract is able to exploit the CapsuleMinter's token storing/redeeming methods.

Parameters:

  • _name: (string) - the name of the Capsule Collection

  • _symbol: (string) - the symbol of the Capsule Collection

  • _tokenURIOwner: (address) - the address of the Capsule Collection tokenURIOwner (also known as the Metamaster)

  • _isCollectionPrivate: (boolean) - whether the Capsule Collection is designated as private

Returns: (address) - The address of the newly deployed Capsule Collection.

Example Capsule Collection Creation Call

An example call is shown here:

createCapsuleCollection(
    "Capsule",
    "CNFT",
    ZERO_ADDRESS,
    false,
    { value: 0.025 }
);

This call will create a Capsule Collection:

  • Named Capsule

  • With Symbol CNFT

  • Whose Metamaster is the Zero Address (0x0000000000000000000000000000000000000000). The metamaster has control over ALL metadata in the collection. In most cases, you'd either set the Metamaster to your address (so that you'd have ownership over all metadata to change at any time), or the zero address (so that your Capsule NFTs metadata link can never be changed after mint).

  • With Capsule Collection privacy boolean false, meaning this is a public Capsule Collection. A public Capsule Collection allows anyone from any address to mint Capsule NFTs within the Capsule Collection. A private Capsule Collection (true) only allows the owner to mint Capsule NFTs within the Capsule Collection.

Note: The owner of the Capsule Collection is set to the address which calls the `createCapsuleCollection` method. The owner may change ownership of a Capsule Collection at any time.

With ETH fee amount specified. This is the a Capsule Collection.

required amount to create
CapsuleFactory.sol