Full lesson
headlined
2nd Place: Gaming Track Colosseum, $10,000 Reward.
What it does
From the project README:
⚠️ Make sure your Solana-compatible wallet is set to DEVNET! You are accessing a beta version of the game. ⚠️
- Original
- suessmeister/headlined
- SuperStack fork
- Blockchains/headlined @
518f43d - Stars
- 1
- Last push (original)
- 2025-05-17
- Languages
- TypeScript, Python, HTML, Rust, JavaScript, CSS
- Detected stack
- AnchorMetaplexNext.jsweb3.js
- Categories
- Gaming
- Licence
- MIT
- Homepage
- https://headlined.fun
Architecture
54 source files. By extension: .tsx ×31, .ts ×18, .py ×3, .rs ×1, .js ×1.
| Top-level directory | Source files |
|---|---|
src | 40 |
anchor | 8 |
backend | 3 |
scripts | 2 |
(root) | 1 |
On-chain programs: anchor/programs/headlined
Dapp: devnet deploy pending
⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/headlined/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
anchor/programs/headlined/src/lib.rs L13–36 @ 518f43d · MIT · original}; use anchor_spl::token::{Token, ID as TOKEN_PROGRAM_ID}; declare_id!("9YhZtfHPa9YY13AXr7PhNV1YnWPkqhvd6g4NRTfNNcND"); #[program]pub mod headlined { use anchor_lang::accounts::signer; use mpl_token_metadata::types::Collection; use super::*; pub fn create_collection( ctx: Context<CreateCollection>, title: String, symbol: String, uri: String, ) -> Result<()> { let mint_key = ctx.accounts.collection_mint.key(); let bump = ctx.bumps.collection_authority; let signer_seeds = &[b"collection_authority", ctx.program_id.as_ref(), &[bump]]; let (metadata_pda, _bump) = Pubkey::find_program_address(- Line 33
let bump = ctx.bumps.collection_authority;: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 34
let signer_seeds = &[b"collection_authority", ctx.program_id.as_ref(), &[bump]];: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 36
let (metadata_pda, _bump) = Pubkey::find_program_address(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
src/app/arsenal/page.tsx L205–228 @ 518f43d · MIT · original publicKey, publicKey, TOKEN_PROGRAM_ID, ); const ata = await getAssociatedTokenAddress(gunMint.publicKey, publicKey); const ataIx = createAssociatedTokenAccountInstruction( publicKey, ata, publicKey, gunMint.publicKey, ); const mintToIx = createMintToInstruction( gunMint.publicKey, ata, publicKey, 1, ); const [metadataPda, metadataBump] = PublicKey.findProgramAddressSync( [ Buffer.from("metadata"), MPL_TOKEN_METADATA_PROGRAM_ID.toBuffer(), gunMint.publicKey.toBuffer(),- Line 217
const mintToIx = createMintToInstruction(: Mints new tokens. The mint authority must sign. - Line 224
const [metadataPda, metadataBump] = PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | next dev |
. | npm run start | next start |
. | npm run build | next build |
. | npm run lint | next lint |
anchor | anchor build | compile programs and generate IDLs |
anchor | anchor test | local validator + test suite |
anchor | anchor run test | ../node_modules/.bin/jest --preset ts-jest |
anchor | anchor run create_collection | ts-node ../scripts/create_collection.ts |
anchor | anchor run one | ts-node ../scripts/one_col.ts |
What you could build from it
- Fork the SuperStack copy and extend it within the Gaming gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Compressed NFTs and state compression
- Learn the pattern first: Building and sending transactions from a client