Week 1 assignment: mint an SPL token, mint an NFT with MPL Core, and update its metadata. Also does both optional extras: transfer the NFT to a new owner, and burn it to get the rent back.
All tests run locally with LiteSVM. No wallet, no RPC, no devnet needed.
- Mints an SPL token and transfers some to another wallet (
transfer_checked). - Mints an NFT using MPL Core, with a name, URI, and update authority.
- Updates the NFT's name and URI as the update authority (and proves a non-authority can't).
- Transfers the NFT to a new owner.
- Burns the NFT and reclaims the rent.
cargo test -- --nocaptureBoth tests should pass:
test spl_token_mint_and_transfer ... ok
test mpl_core_create_update_transfer_and_burn ... ok
src/lib.rs: instruction builders for each step (mint, transfer, create/update/transfer/burn NFT).tests/lab.rs: runs them against LiteSVM and checks the resulting on-chain data, including that only the right authority can update or burn.tests/fixtures/mpl_core.so: a copy of the real MPL Core program, so tests don't need devnet.
MIT
