0xPratik 75f1ce30d0 added the README 1 year ago
..
migrations 9fe5a0327f added cnft-burn example 1 year ago
programs 1408714c10 removed unused import 1 year ago
tests 75f1ce30d0 added the README 1 year ago
.gitignore 9fe5a0327f added cnft-burn example 1 year ago
.prettierignore 9fe5a0327f added cnft-burn example 1 year ago
Anchor.toml 920c71f25e added back the burning code 1 year ago
Cargo.toml 9fe5a0327f added cnft-burn example 1 year ago
README.md 75f1ce30d0 added the README 1 year ago
package.json d2e6401f5a the program compiles and tests are running 1 year ago
tsconfig.json 9fe5a0327f added cnft-burn example 1 year ago

README.md

cnft-burn

This repository contains the cnft-burn program, a Solana Anchor program that allows you to burn compressed NFTs (cNFTs) in your collection. The program interacts with the Metaplex Bubblegum program through CPI to burn cNFTs.

Components

  • programs: Contains the anchor program
  • tests: Contains the tests for the anchor program

Deployment

The program is deployed on devnet at FbeHkUEevbhKmdk5FE5orcTaJkCYn5drwZoZXaxQXXNn. You can deploy it yourself by changing the respective values in lib.rs and Anchor.toml.

How to run

  1. Configure RPC path in utils/readAPI.ts. Personal preference: Helius RPCs.
  2. run anchor build at the root of the project i.e cnft-burn in this case.
  3. run anchor deploy to deploy and test the program on your own cluster.
  4. to run the tests you need to have the tree address and the assetId of the cNFT you want to burn. You need to make sure the signer of the instruction is also the owner of that cNFT. if you don't have the tree and assetId you can create the tree and mint the cNFT using compressed-nfts and use the scripts createAndMint.ts to create the tree and get the tree address and fetchNFTsByCollection.ts to get the assetId based on the collection mint address which will be provided in the createAndMint script.
  5. run anchor test to run the tests.

Acknowledgements

This Example program would not have been possible without the work of:

  • Metaplex for providing the Bubblegum program with ix builders.
  • @nickfrosty for providing the same code for fetching and creating cNFTs.