In this project, I have created an NFT on Solana Blockchain. All boilerplate code is being generated by Codigo ai using nft.yaml as the main file of this project. The smart contract for NFT has three functionalities.
- Mint: The mint instruction is responsible for creating NFT. This process is essential for introducing new tokens into the system. Based on the inputs we have (regarding color, description, and rarity), we will create gem metadata and mint our NFT.
- Transfer: The transfer instruction allows tokens or NFTs to be sent from one account to another.
- Burn: The burn instruction is used to destroy tokens or NFTs, removing them from circulation.
- Build the contract: Navigate to program directory
cargo build-sbf
. - Set your config file to connect to devnet:
solana config set --url devnet
. - Build and Deploy the Contract:
Build and Deploy the Contract
, Save the programID. - Download Dependencies: Navigate to program_client directory
yarn install
and alsoyarn add @solana/spl-token
. - Run app.ts:
npx ts-node app.ts <YOUR_PROGRAM_ID>
.