MultiversX NFT collection with Elven Tools
Tags: blockchain, rust, smartcontract, javascript
Published: 2022-03-12 17:12:43

The MultiversX blockchain offers a cheap solution for NFT authors. The protocol natively supports NFTs. These are ESDTs with additional metadata and attributes. In short, the smart contract is not required to issue them, but when it comes to whole collection distribution/selling, it is crucial to have it and prove that the distribution goes in a decentralized manner.

I won't go deep into technical stuff here. You can read more about the ESDTs and NFTs in the official documentation. I want to focus more on using open source tooling to run a simple candy-machine-like version of the smart contract.

The toolset is called Elven Tools, and you can find it here www.elven.tools.

The core of the tools is the smart contract that alow to mint the tokens randomly. Besides that, there is also a CLI tool that simplifies the setup, deployment, and interactions with the smart contract. The dapp - landing page is in progress too. So basically, it is a complete toolset where anyone can run their project, even without technical knowledge or only with basic knowledge about how to work with the terminal.

**Let's see how to start with it.**

If you want to jump in and start testing stuff, you can start with the CLI only. It will deploy the smart contract directly from its repository. It will be deployed to the devnet chain. So you don't have to worry about real money etc.

Before we start using the CLI, you must prepare your devnet wallet. You can create one here: https://devnet-wallet.multiversx.com/. Also, remember to fund it using the faucet accessible after logging in.

Now we can install the [elven-tools](https://www.npmjs.com/package/elven-tools) CLI. 
You can install it globally `npm install -g elven-tools`.
Remember that you would need the NodeJS environment configured.

**Here are the minimum required steps with elven-tools:**

1. Prepare a directory where you can work.
2. `elven-tools derive-pem`. Derive the PEM file. It will be required for all operations. You need to provide your seed phrase. The walletKey.pem file will be created in the same directory.
3. `elven-tools deploy nft-minter`. Configure and deploy the smart contract. You will be asked about a couple of configuration settings, like base IPFS CIDs collection size. I'll leave links and more explanations on how it works later in the article.
4. `elven-tools nft-minter issue-collection-token`. Create the collection identifier/ticker. This will be your main ticker for the collection. All NFTs will be minted under this id with additional suffixes. This is important because it is the main identifier for your collection.
5. `elven-tools nft-minter set-roles`. Add proper roles. It will add proper roles to be able to create new tokens.
6. `elven-tools nft-minter start-minting`. Start minting process. This command will enable the minting process. You can also pause it later.
7. `elven-tools nft-minter mint`. Mint. Here provide the number of tokens to mint and mint them. It will randomly mint the tokens and send them to the caller. You will need to pay for them.

This path is very basic. You can do a lot more with this toolset. Read more about it here:
https://www.elven.tools/docs/jump-start.html
https://www.elven.tools/docs/recipes.html
https://www.elven.tools/docs/cli-commands.html
https://www.elven.tools/docs/sc-endpoints.html
https://www.elven.tools/docs/landing-page.html

Also, check the walkthrough video:

{% embed https://youtu.be/Jou5jn8PFz8 %}

**Ok, let's back to the functionality and possibilities.**

The smart contract allows you to do more things than described above. You can split the whole collection into a couple of drops. You can change the prices when needed. You can also prepare an allowlist and allow to mint for only eligible addresses. You can also make the giveaway and give the tokens to chosen addresses. Check the [Elven Tools Worflows](https://www.elven.tools/docs/elven-tools-workflows.html) article to learn more about it.

**Summary**

The toolset is open source and free to use by anyone. If you need to modify the smart contract, you can still work with the CLI deploying from the local file system. You'll find all the information on how to do that in the docs here: https://www.elven.tools/docs/recipes.html.

Repositories:
- https://github.com/ElvenTools/elven-nft-minter-sc
- https://github.com/ElvenTools/elven-tools-cli
- https://github.com/ElvenTools/elven-tools-dapp

Elven Tools Minter Dapp demo: https://dapp-demo.elven.tools/

Other tools:
- [MultiversX Browser Javascript SDK](https://www.elvenjs.com)
- [MultiversX CLI for simpler interactions](https://github.com/xdevguild/buildo-begins)
- [MultiversX Nextjs Dapp template](https://github.com/xdevguild/nextjs-dapp-template)

Please stay tuned. Follow me on [GitHub](https://github.com/juliancwirko) and [Twitter](https://twitter.com/theJulianIo). Thanks!