How to create a Dynamic NFT Minter bot using Solidity and Python? — Pt 1.
In this article, I’m going to show you, how you can create a NFT minter bot using Solidity, Chainlink, Python and Telebot.
First, let’s talk about how this project is looks like. Imagine that you have a flower NFT which grows up in overtime. It means that we have a dynamic NFT. In fact, we want to create a dynamic NFT minter bot which set dynamic metadata and mint the NFT. In overtime, Chainlink keepers help us to change the metadata automatically. If you’re not familiar with Chainlink, just take a look at this article.
Now, in this step, I’m going to learn you the implementation of the NFT minter smart contract. In our smart contract, we will use Chainlink keepers and ERC721 standards from OpenZeppelin.
One of the important things that you should pay attention to it is the metadata. We should get and save the metadata URLs in the blockchain because we need to set up the new token URL for each NFT. So, each user should have a list of metadata URLs in our contract, and we write a function that allows users to set up their metadata.
As you see, we have a token id using OpenZeppelin Counter library that help us to set up token id. In the next section we have a list of string which contains metadata URLs, and also we have three diffrents mappings for handling metadata. The first mapping will store the list of URLs with key value of message sender, and the key value of the second mapping is token id. The last mapping is use for to keep the index of the current URLs.
The set_uri() function allows users, pass three specific metadata URLs and store that in the blockchain, then the user will use min_nft() function to mint the NFT. This function will get the first metadata URL, and then it’s going to mint the NFT.
The performUpkeep function will change and update our NFTs metadata by calling growNFT().
Now, your Dynamic NFT minter smart contract is ready to deploy. Check github repository here.
Stay tuned for the next article, where I will explain how to use IPFS and Python to store metadata and interact with smart contract using Web3py. Share your comments and critique, I’d love to hear it 🙂
How to create a Dynamic NFT Minter bot using Solidity and Python? — Pt 1. was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.