Create multiple collections in a single Smart Contract

WP Smart Contracts
4 min readMay 17, 2022

--

Imagine that you want to create multiple collections using a single Smart Contract, you can now achieve that using the new “Galleries” feature of the WP Smart Contracts plugin.

Create the art

We need to start creating our own art pieces.

For this tutorial I followed the simple steps to create your own“Crypto Punks”:

I did it using GIMP, instead of Photoshop, the steps and the look is almost the same for this basic exercise:

Our quick crypto punks art pieces

Adding a galleries to a Smart Contract Collection

First we need to create our smart contract collection, and then we are going to use the Bulk Mint feature to speed up the process. If you need more information about this feature you can visit this page:

1. Upload the images to the server

The first step is to load all our images to the server in folder named “wpsc” inside the “wp-content/uploads” folder.

Images files on the /uploads/wpsc folder

2. Prepare our CSV file

Now we are going to create a CSV file with all the data we want for the NFTs:

Our CSV to load the data

Our file consist of twelve rows, one for each image, with the following:

  • Image file
  • Quantity
  • Title
  • Description
  • Taxonomy
  • Attributes
  • Galleries

For more information about each of the fields visit the documentation, but for the purposes of this article we are interested in the last field: Galleries.

In the last column you can specify one or several galleries, we are interested in creating three galleries, one for every four elements, we named them “Gallery 1”, “Gallery 2” and “Gallery 3”

3. Enable Galleries in the Collection

By default Galleries are not enabled in the collection, so we go to our collection and enable it.

For this example we are going to create a Yuzu flavor NFT Collection. But Galleries (or sub-collections) are available for all flavors in the plugin.

Remember to enable the galleries option in the selected collection. For this we go to our wp-admin and edit the collection, there we scroll to the “Options” section, and locate the “Enable Sub-Collections” field.

Enable Galleries

We have three options:

  • Disabled

Or Enabled, with two options:

  • Enabled — Show galleries as Tabs
Galleries as Tabs
  • Enabled — Show galleries as Drop-down
Galleries as Dropdown

Of course, which one to use depend basically of your theme view and the number of Galleries you are planning to use. For large numbers of Galleries it is best to use a searchable dropdown.

4. Run the Bulk-Mint Process

Now we are ready to run the bulk mint process and upload our CSV to the system to automatically create all the NFT items and Galleries.

If the Bulk-Mint process is not available for your Smart Contract flavor you can always create galleries manually. Read the docs for more information on this.

Take a look to the whole process in the following video:

5. The resulting collection

Click here to see the demo collection we created:

You can see the tabs “Gallery 1”,“Gallery 2” and “Gallery 3” at the top of the page.

This tabs will filter the collection to the items that belong to this gallery, making easy to have multiple users, all of them using their own independent galleries in one single smart contract.

Please visit the docs to learn more about the multiple options that you and your users have to handle multiple collections in one single smart contract:

https://wpsmartcontracts.com/docs/doc-nft-galleries-manage.php

--

--

No responses yet