Skip to content

About

SPL token mint and transfer, plus the full MPL Core NFT lifecycle (create, update, transfer, burn). Tested end-to-end with LiteSVM, no wallet or RPC needed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPL Token + MPL Core Lab

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.

What it does

  • 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.

Run it

cargo test -- --nocapture

Both tests should pass:

test spl_token_mint_and_transfer ... ok
test mpl_core_create_update_transfer_and_burn ... ok

Tests passing

Code

  • 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.

License

MIT

About

SPL token mint and transfer, plus the full MPL Core NFT lifecycle (create, update, transfer, burn). Tested end-to-end with LiteSVM, no wallet or RPC needed.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages