Full lesson
breakout_demo_25
Demo created for Solana London Buildstation (aka Breakout) Hackathon.
What it does
From the project README:
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
- Original
- saiph-meg/breakout_demo_25
- SuperStack fork
- Blockchains/breakout_demo_25 @
39d6837 - Stars
- 1
- Last push (original)
- 2025-05-16
- Languages
- TypeScript, Rust, JavaScript
- Detected stack
- Next.js
- Categories
- Other
- Licence
- MIT
Architecture
45 source files. By extension: .ts ×28, .tsx ×12, .js ×3, .rs ×2.
| Top-level directory | Source files |
|---|---|
src | 41 |
(root) | 2 |
SOL | 2 |
Dapp: deploying
This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/breakout-demo-25/, once it is deployed and checked on devnet. Until then, 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.
SOL/lib.rs L205–228 @ 39d6837 · MIT · original#[instruction(id: u64)]pub struct CreateNFT<'info> { #[account(mut)] pub authority: Signer<'info>, #[account(mut)] pub payer: Signer<'info>, #[account( init, payer = payer, mint::decimals = 0, mint::authority = authority, mint::freeze_authority = authority, seeds = ["mint".as_bytes(), id.to_le_bytes().as_ref()], bump, )] pub mint: Account<'info, Mint>, #[account( init_if_needed, payer = payer, associated_token::mint = mint, associated_token::authority = payer, )] pub token_account: Account<'info, TokenAccount>, pub associated_token_program: Program<'info, AssociatedToken>,- Line 208
pub authority: Signer<'info>,: Requires this account to have signed the transaction. - Line 212
init,: Creates and pays for a new account. Space and payer must be specified. - Line 217
seeds = ["mint".as_bytes(), id.to_le_bytes().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 218
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 222
init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs.
SOL/lib_createnft.rs L109–132 @ 39d6837 · MIT · originalpub struct CreateNFT<'info> { #[account(mut)] pub authority: Signer<'info>, #[account(mut)] pub payer: Signer<'info>, #[account( init, payer = payer, mint::decimals = 0, mint::authority = authority, mint::freeze_authority = authority, seeds = ["mint".as_bytes(), id.to_le_bytes().as_ref()], bump, )] pub mint: Account<'info, Mint>, #[account( init_if_needed, payer = payer, associated_token::mint = mint, associated_token::authority = payer, )] pub token_account: Account<'info, TokenAccount>, pub associated_token_program: Program<'info, AssociatedToken>, pub rent: Sysvar<'info, Rent>,- Line 111
pub authority: Signer<'info>,: Requires this account to have signed the transaction. - Line 115
init,: Creates and pays for a new account. Space and payer must be specified. - Line 120
seeds = ["mint".as_bytes(), id.to_le_bytes().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 121
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 125
init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs.
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 | eslint --fix . |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)