Deploying a wrapped NFT App using the Andromeda CLI.
If unfimailar with the steps of deploying an app, go back to the first example 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.
For this example, we will be utilizing our wrapped-nft ADO to wrap a CW721-base nft and leverage the andromeda TransferAgreement functionality to sell the token. We will build our project using our CLI.
We will not build this example using the App contract.
The steps we will perform:
Mint a token using the CW721-base contract found in cw-nfts repo.
Send it to wrapper ADO to have it wrapped.
Apply a TransferAgreement for the token.
Buy the token using another address.
Unwrap the token to get the original back.
We will need to use the following andromeda contracts in addition to the base-nft contract:
First we need to mint a regular nft from the cw-nft repo. To do this, we first need to clone the repo, build the contract and upload it to the chain we want to deploy on. To do so, we perform the following steps:
Start a new project in your IDE
In the terminal:
git clone https://github.com/CosmWasm/cw-nfts.git
Then compile the CW721 base contract. When done, the contract .wasm file should appear in the artifacts directory.
Let us open the CLI by running andr in our terminal from artifacts directory. We then need to choose the chain we want to deploy on:
Feel free to use any of the chains available
Then select the chain to deploy on.
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 chain's faucet to request some tokens (Usually the faucet will be in the Chain's discord).
Uploading the Contract
To upload the contract, we run:
wasm upload cw721_base.wasm
The contract will be uploaded to chain and the code Id will be returned.
The instantiation message for CW721 base nft is the following:
Now that we have our contract uploaded we can instantiate a CW721:
Use the code Id that you got when uploading the contract instead of 201.
As we can see, when we unwrapped the token, the wrapped token is removed and the original token is back in our address.
The Andromeda wrapped ADO is one of many custom contracts that the Andromeda team has built to allow use cases such as the one we have demonstrated above. We can wrap tokens to leverage any of the functionalities that Andromeda has built. For example we can wrap a token and sell it in an auction, offers, and even use the staking nft to allow staking of these tokens. The possibilites are endless and only limited by the user's imagination.