Sol.College

Structure lesson (licence does not allow quoting code)

BreakOut-contracts

Original
pramaths/BreakOut-contracts
SuperStack fork
Blockchains/BreakOut-contracts @ 41ec012
Stars
0
Last push (original)
2025-05-15
Languages
TypeScript, Rust
Detected stack
Anchor
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

23 source files. By extension: .rs ×19, .ts ×4.

Top-level directorySource files
programs19
tests2
migrations1
cli1

On-chain programs: programs/spotwin

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
initializeInitializeprograms/spotwin/src/lib.rs:19
create_contestCreateContestprograms/spotwin/src/lib.rs:24
join_contestJoinContestprograms/spotwin/src/lib.rs:28
update_answersUpdateAnswersprograms/spotwin/src/lib.rs:32
lock_contestLockContestprograms/spotwin/src/lib.rs:36
post_answer_keyPostAnswerKeyprograms/spotwin/src/lib.rs:40
post_payout_rootPostPayoutRootprograms/spotwin/src/lib.rs:44
stake_tokensStakeTokensprograms/spotwin/src/lib.rs:63
unstake_tokensUnstakeTokensprograms/spotwin/src/lib.rs:67
handlerSweepVaultprograms/spotwin/src/instructions/sweep_fees.rs:54
handlerUpdateAnswersprograms/spotwin/src/instructions/update_answers.rs:42
handlerLockContestprograms/spotwin/src/instructions/lock_contest.rs:22

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
cli/src/sdk.tsPublicKey, SystemProgram, AnchorProvider, findProgramAddressSync, Program, Connection
tests/happy-flow.tsPublicKey, findProgramAddressSync, SystemProgram, mintTo, Program, createMint
programs/spotwin/src/instructions/send_batch.rsseeds, Pubkey, transfer, AccountInfo, has_one, Program
programs/spotwin/src/instructions/join_contest.rsseeds, Program, has_one, Pubkey, CpiContext, transfer
programs/spotwin/src/instructions/stake_tokens.rsseeds, Program, init_if_needed, invoke_signed, CpiContext, transfer
programs/spotwin/src/instructions/sweep_fees.rsseeds, has_one, Program, CpiContext
programs/spotwin/src/instructions/unstake_tokens.rsseeds, invoke_signed, Program, CpiContext, transfer
programs/spotwin/src/instructions/create_contest.rsseeds, Program
programs/spotwin/src/instructions/initialize_stake.rsseeds, Program
programs/spotwin/src/instructions/update_answers.rsseeds, has_one
tests/spotwin.tsProgram, AnchorProvider
programs/spotwin/src/state/contest.rsPubkey

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/breakout-contracts/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

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.

DirectoryCommandRuns
.npm run lint
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it