# 🖼️ NFTs
NFTs, valued for their uniqueness, are digital assets commonly used in digital art, collectibles, and gaming. To deploy an NFT contract on Nibiru Chain, developers can customize the CW721-based contract found in the cw-nfts repository to adhere to the CW721 standard, then use the nibid CLI for deployment.
# Non-Fungible Tokens (NFTs)
Non-Fungible Tokens (NFTs) are a type of digital asset that is unique and indivisible, each possessing distinct identities and properties. Unlike fungible tokens, which are interchangeable on a one-to-one basis, NFTs cannot be exchanged in a like-for-like manner due to their unique attributes and characteristics. These unique attributes are typically encoded in the token's metadata, which includes information such as the token's creator, creation date, and any additional properties that make it distinct from other tokens in the same series or collection.
In the blockchain industry, NFTs have gained significant traction and are used in various applications such as digital art, collectibles, and gaming. NFTs leverage blockchain technology to provide irrefutable proof of ownership and provenance, ensuring that each token is verifiably scarce and authentic.
# Setting Up Your NFT Contract
On Nibiru Chain, developers can deploy NFT contracts following the CW721
standard.
This standard defines a set of interfaces and methods that enable the creation,
transfer, and management of NFTs on the blockchain. Developers can customize the
CW721-based
contract from the cw-nfts repository to suit their specific requirements
and deploy it using the nibid CLI. Once deployed, these NFTs can be bought, sold, and
traded on the Nibiru Chain, leveraging the security and transparency of blockchain technology.
In order to create your very own NFT contract on Nibiru, you must first set your environemnt bu following the Getting Started guide.
Next, clone the CW721-base
contract from the cw-nfts
repository (opens new window).
To verify and test your setup, run to ensure all pre-exting tests succeed:
# Understanding & Customizing Cw721-base
The CW721-base
contract serves as a foundational template for creating non-fungible tokens (NFTs) on the CosmWasm blockchain. It adheres to the CW721 standard and provides functionality for minting new tokens, transferring ownership, and querying token information. Developers can customize this contract by extending its functionality or incorporating its logic into other contracts to create CW721-compatible NFTs with bespoke features.
To customize the CW721-base
contract, it is essential to understand its implementation and structure. The contract's logic can be found here (opens new window). Familiarize yourself with this codebase to modify it according to your project's specifications and requirements. This understanding will enable you to tailor the contract to suit your unique use cases, ensuring compatibility with the CW721 standard while incorporating your desired functionality.
# Build the Contract
The process of deploying the contract mirrors that of any other CW contract. Initially, the contract is compiled into a binary .wasm
file. Subsequently, optimization is carried out using the CosmWasm Rust Optimizer (opens new window).
This will generate the optimized .wasm
binary contract in artifacts/cw721-base.wasm
.
# Deploy & Instantiate the Contract
Interacting with the contract similar to how you manage any CosmWasm contract:
Instantiate your contract using the $CODE_ID
, but first let's save the instantiation message:
With this, you have your very own NFT contract address which you can utilize futher.