PFP NFTs on the MultiversX blockchain
The MultiversX blockchain isn't very popular yet, but it already has a great NFT ecosystem. I have been learning to develop in this network for some time now, and I would like to introduce you to the NFTs on MultiversX in the context of the toolset I built. Let's dive in.
I already have some articles about MultiversX on the blog, but as you probably know, IT and especially blockchain evolves quickly, and there are a lot of changes in a short amount of time. So I think it will be an excellent time to remind the toolset and present it as a complete solution.
You can check the newest walkthrough video below if you don't want to read about it.
Intro
First, let's see what we need to get the complete solution to run the PFP NFT collection. It will be for sure:
- a smart contract (for example, candy-machine like random distribution)
- tooling, which will simplify the process of deployment, configuration, and interactions with the smart contract
- frontend minter application to allow people to mint in a convenient way
Here I won't write about the solutions that are provided by marketplaces. They are good, so check them too if you are interested and maybe not so technical person. Or when you want to have it all more simplified.
The article is about a custom approach where you will have control over everything. I won't probably go deep technically because it should be more of an introduction than a tutorial, but I will leave links with more knowledge.
All mentioned points and tools are included in the Elven Tools, and we will take a closer look at it now.
The smart contract
Elven Tools provides a ready-to-use smart contract, a simple candy-machine-like random distribution of the NFTs in a predefined collection. There are additional functionalities like splitting the minting process into 'waves' called 'drops'. Also, it is possible to create an allowlist and populate it with eligible addresses. You can also pause and start the minting process.
You will read more about different strategies here: Elven Tools workflows, and if you want to read more about the Elven Tools smart contract, start here: Smart Contract introduction. And of course, the source code: elven-nft-minter-sc.
You probably think it is too complicated to deploy, and configuration is complex, and you could be correct, but with Elven Tools, it is simple enough. Besides the smart contract, a CLI tool will guide you with simple prompts on how to deploy and configure your smart contract and collection.
CLI for interactions and deployment
The CLI tool is built upon the MultiversX JS SDK written in Typescript. SDK for interactions with the protocol and smart contracts. And the Elven Tools CLI is a wrapper around it with predefined commands that greatly simplify the process.
You can install the Elven Tools CLI directly from the Npm registry. By npm install elven-tools -g
, then you can hit elven-tools --help
to check all the commands. You will also find all in the jumpstart section in the docs: Elven Tools Jump start, and here is the list of commands: Elven Tools CLI commands.
The CLI tool will guide you through the deployment process. What is significant here is that you don't need to download anything locally. You can use the CLI to deploy the smart contract from its GitHub repository. Of course, this is only in a case when you don't want to provide any modifications to it. If you modify the smart contract, you can still use the CLI. You can build your custom smart contract and copy the wasm file to be searchable by the CLI. Then the CLI can deploy it from the local file system. Read more about it here: How to work with the Smart Contract locally.
The CLI will deploy and set up the smart contract. It will be ready to work. You can also use the CLI as the buyer, not only as the smart contract owner. You can mint tokens using it. But of course, this isn't the optimal way of doing that. It is why you need to have a public minter dApp. Let's see what Elven Tools can offer in that matter.
Don't forget to check its repository: elven-tools-cli.
Minter dApp
The Elven Tools Dapp is a Nextjs application with some excellent features. First, it incorporates the JS SDK tooling for logging in using the wallet provider. It can be one of four types: Web Wallet, xPortal mobile app, MultiversX DeFi browser extension, and Ledger hardware wallet. So basically, you can log in with your wallet.
The dApp is prepared for the Elven Tools Smart Contract, but you can modify it and use it in other projects. The dApp also offers a couple of helpful React hooks, so usage is quite simple. Besides the login-related operations, they will also help with signing and sending transactions.
Please read about it starting here: Elven Tools Minter Dapp introduction. You will also find a live demo here: Elven Tools Dapp demo where you can mint real NFTs on the devnet.
Check its repository here: elven-tools-dapp.
Additional tooling
The Elven Tools CLI can also do snapshots to get the owners of the collection's NFTs. It will query the MultiversX API and get all the owners' addresses. Then you can use the same output file and prepare the distribution of the tokens, for example, giveaway of the EGLD tokens to the loyal owners. OR you can giveaway ESDTs, SFTs, or Meta ESDTs.
Read more about it here: How to get owners' addresses using the collection ticker and How to distribute tokens to NFT owners.
Additionally, two helper repositories can:
- Export to CSV - for preparing more readable CSV file. It will use the output from the snapshot functionality.
- Snapshots intersection is a helpful script that can serve as a way to get loyal owners. You can create a few snapshots and check if the address exists on each list. You can reward long-time holders.
Summary
The article was a quick introduction to the Elven Tools. The project has been in active development for a couple of months. It is a complete solution but requires a couple of improvements.
There are also plans to make it even more functional. It will handle more types of smart contracts in the future, and the CLI will get more functionality. The Dapp is also an exciting project. It can be improved in a lot of different ways. Performance adjustments and better UI and functionalities are only the beginning.
If you want to be up to date with the project, please follow it on Twitter: @ElvenTools.
You can also keep tracking the progress here: Elven Tools Kanban boards.
Let me know what you think about the project. Tell me if you used it or at least some parts of it. All kinds of feedback will be appreciated.