What: Anchor program that restricts an instruction to wallets holding a given NFT (SPL token mint with supply 1). This is contest-ready and includes working unit tests.
Why this approach:
- Reliable in Anchor tests and local validators.
- Easy to extend to Metaplex metadata verification (see extension TODO below).
Prereqs: anchor, rust, solana toolset, Node.js.
# install JS deps
npm install
# build program
anchor build
# run tests (starts local validator automatically)
anchor testIf you need to assert that the NFT belongs to a verified Metaplex collection, extend the ExclusiveAction accounts to include the Metadata account from the Metaplex Token Metadata program and verify collection.verified using mpl-token-metadata or mpl-core logic inside the program. This scaffold uses token-account checks for reliability and speed in tests; add Metaplex checks if judges expect mpl-core usage.
- Uses Anchor
0.31.1. If you hit compatibility errors with Metaplex crates later, you may need to switch to0.30.1.
