Marketplace App
Deploying an NFT Marketplace App
Last updated
Was this helpful?
Deploying an NFT Marketplace App
Last updated
Was this helpful?
If unfamiliar with the steps of deploying an app, go back to the where we explain in detail all the different parts of deploying an App.
If any of the messages in this example do not work, you might want to cross reference the messages with the ADO specific section which always contains the latest ADO versions to make sure they are correct. Other than that the logic will remain the same.
Make sure to read the before going through building an app.
For this App, we will be selling NFTs using the for native tokens. The steps that will be performed:
Mint NFTs
Setup the marketplace
Send the NFTs to the marketplace to be sold
Buy the NFTs
The components/ADOs we would need:
(NFT contract)
Although not necessary, if you are unfamiliar with these ADOs, it is suggested to read through each of the them before deploying an app.
Let us first start by representing the instantiation message for each of our ADOs:
Keep in mind that the app takes these messages as base64 encoded.
Make sure to set the minter as your own address.
As base64:
As base64:
There are several components found here. A simple name for the app, the components of the app itself and a reference to the “Kernel”. Each component of the app provides two values: a name used for referencing for other components within the app, and the base64 encoded instantiation message.
First, let us open the CLI by running andr
in our terminal. We then need to choose the chain we want to deploy on. Run "chain use"
in the CLI and select the testnet that you want to deploy on. For this example I will be using the Andromeda test-net Galileo-3.
If this is the first time using the CLI make sure to run "wallet add <wallet-name>"
in order to create a wallet. Then go to that chain's faucet (usually located in their discord) and request tokens.
We have already uploaded the App ADO to the Andromeda testnet. A simple way to check the latest code id for the App ADO is to query it from the ADODB using the chain you want to use.
In the CLI, while connected to the chain of choice, run:
The code Id to use will be returned.
Now we can instantiate our App. We will be using our wasm command to instantiate our app:
Do not copy and paste the command below as it will not work. Make sure to make the appropriate changes before running the command.
Replace the <code_id> with the returned code-id for the app ADO.
You will be using the contract addresses that were instantiated for you instead of the ones in this tutorial.
We will only mint one NFT in this example as the process for selling more NFTs will be the same. Feel free to mint as many as you want.
Now we need to mint an NFT to send to the marketplace.
In order to start a sale on the NFT, we need to send it to the marketplace ADO.
The attached message is a start_sale
message to start the auction when the NFT is sent.
Now let us buy the NFT. On the CLI:
Make sure to use a wallet other than the owner of the NFT as the owner cannot buy the NFT.
Make sure to attach funds to the message equal to the listed price of the NFT which is 1000uandr in our case.
We have seen in this example how we can easily sell NFTs using our marketplace ADO. You can customize this application as you see fit. Some possible modifications you can make for this application:
Add start and end times for the NFT sale.
Use a CW20 token as the purchasing token for the NFTs.
Add a splitter recipient to the start sale message to directly split all the funds made from the NFT sales to any amount of addresses. You can even have the splitter send some of the tokens to another ADO and execute some message there.
The Kernel address used here might be outdated in the future. Check our to get the latest Kernel or run "chain config" in CLI which will also display the address.
If you do not have the CLI downloaded, go to the section to get the latest version.