Step 3: Deploy contracts
Last updated
Last updated
Before we start deploying the contracts, make sure you've created the project on the Dev3 Dashboard. This is completely free, and you can do it in only a few clicks. If you haven't already, you can find a detailed guide on how to create the project here.
If you only want to play around and test everything, we advise you to create the project on one of our supported testnets such as Polygon Mumbai. The guide for creating the Dev3 project will lead you to create the project on the Mumbai testnet.
You can of course decide to create the project and launch the NFT collection on some other blockchain network which we support (Polygon, Ethereum, Aurora, ...) but this will cost gas and you will have to obtain gas tokens before creating the project and the contracts.
If you have successfully created the project, move on by opening the project dashboard. First, we'll create the NFT token by deploying one of the NFT contracts by using the template found on the project dashboard. This is how you find it:
We selected the deployment from template option, and then found the NFT (Mintable, Burnable, Pausable) implementation in the list. Once we clicked on the Create button, we ended up with the contract creation screen (the last part in the video above). On the creation screen, there are 4 values we need to provide:
alias
token name
token symbol
base token URI
Alias is the smart contract identifier. You will use the alias when integrating the contracts using the Dev3 SDK, so make sure you give your contract a nice readable name, for example: "my-first-nft".
Token name and token symbol will be displayed on blockchain explorers and can not be changed once you deploy the NFT, so choose them wisely. The token symbol is usually the short version of the token name, and you can set these values to whatever you think is the best.
Base token URI is the value you generated in the previous step (Upload metadata chapter). It's the CID hash of your metadata folder but with the added "ipfs://" prefix, and the slash symbol ("/") at the end.
Slash symbol ("/") at the end of the base token URI value is very important. If you forget to add it, your collection items will fail to load properly on the NFT marketplace.
In our case, the full base token URI looks like this:
ipfs://QmYimyZwYP43qWeqj27UiSgZRQLErcCkdt94MEPhDALvko/
In your case, the hash value will be different. Finally, here's the NFT creation screen with the values filled in:
Once you've provided the values, proceed by clicking the "Create contract deployment request" button at the bottom. Then go through the creation flow, and you will end up with the deployed contract. This contract is your NFT token! Congratulations! The process is shown below:
After successful token deployment, you can go back to the project dashboard, and in the Contracts tab you'll notice that your NFT contract is shown:
Now that we have created the contract, we still have to "mint" NFT items, meaning, create NFT items by interacting with the token contract. You can mint items one by one, by calling the mint function on the contract (will be shown below), or we can simply call mintMany function and create all items in one call.
"Mint" is the process of creating a new items in the NFT collection and then transferring them to the owner wallets.
Base token URI which you have defined before will be used to generate new collection items. For example when you call mint for the first time, item 0 is created and the base URI is used to build the link to the item metadata by appending "/0" on the base metadata URI. The second call will create the item with the link pointing to "/1" and so on..
Since our test collection contains 3 images, we're going to mint 3 new items, and we will assign our admin wallet to become their owner. We're going to do all of this in one call by using the mintMany function. This is the last step in launching the NFT collection! Here's how we did it:
The NFT implementation we've deployed, NFT (Mintable, Burnable, Pausable), can only be minted by the contract owner (contract creator). If other wallets try to call the mint the transaction will fail.
After you've done with this step, your NFT collection is live, and you can actually verify this by opening the OpenSea marketplace and searching for your collection. If you have created the project on the Mumbai testnet as explained in our project creation guide, you will have to search for your collection on the OpenSea testnet.
To verify this, copy the address of your NFT contract found on the dashboard:
Then go to the OpenSea testnet and paste the address in the search box. You should be able to see your NFT collection in the recommended results. Open the collection, and you'll see all the items you have just minted to your wallet. In our case, it looks like this:
You can see our collection here. Make sure to send us your collection if you've launched it successfully. 😎
If you've reached this far, congratulations! You've just launched your first NFT collection and minted NFT's to your wallet! You can open any item in the collection above, and you'll see that the owner wallet address is the one you used when deploying the contract and minting NFTs.
Although this NFT was launched on the test network (Polygon Mumbai) you can reproduce all the steps on any other blockchain network of your choice.
Let us know if it worked for you, or if you've come across any problems. Feel free to contact us on: email: hello@dev3.sh discord: https://discord.gg/dev3