Developer - Create a Capsule Collection

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 CapsuleFactory.sol) 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.

Last updated