Note
This is the Anchor v2 copy of this example. Every anchor command on this page
needs the v2 CLI: cargo install anchor-cli --version 2.0.0-rc.1 --locked (avm has
no prebuilt binary for this pre-release). The Anchor v1 version of this example is in
../anchor-v1.
An Anchor program that burns compressed NFTs (cNFTs) in your collection. The program performs a CPI into the Metaplex Bubblegum program to do the burn.
programs/cnft-burn/- the Anchor program.migrations/- deployment script.
A Rust LiteSVM integration suite lives in programs/cnft-burn/tests/. It loads mainnet-dumped fixture binaries for Bubblegum, SPL Account Compression, and SPL Noop from tests/fixtures/ (see the README there), so the CPIs run against the real programs in-process.
cargo build-sbf
cargo testThe program ID declared in programs/cnft-burn/src/lib.rs is C6qxH8n6mZxrrbtMtYWYSp8JR8vkQ55X1o4EBg7twnMv. Whether this address is currently deployed on any cluster is not tracked in this repo - verify with solana program show <id> against the cluster you care about.
To deploy your own copy, change the program ID in lib.rs and Anchor.toml, then run anchor build && anchor deploy.
- Metaplex for the Bubblegum program and instruction builders.
- @nickfrosty for the sample code that fetches and creates cNFTs.