Sol.College

Structure lesson (licence does not allow quoting code)

dapp_wif_hat

Original
nada-r/dapp_wif_hat
SuperStack fork
Blockchains/dapp_wif_hat @ 3a699d9
Stars
2
Last push (original)
2024-04-07
Languages
Rust, Makefile, JavaScript, LLVM, TypeScript, CSS
Detected stack
AnchorSolana Payweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

21 source files. By extension: .js ×10, .tsx ×6, .ts ×4, .rs ×1.

Top-level directorySource files
pages6
(root)5
examples5
solbet-programs3
.history2

On-chain programs: solbet-programs/programs/sol-bet

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
propose_betProposeBetsolbet-programs/programs/sol-bet/src/lib.rs:15
cancel_betCancelBetsolbet-programs/programs/sol-bet/src/lib.rs:51
accept_betAcceptBetsolbet-programs/programs/sol-bet/src/lib.rs:74
resolve_betResolveBetsolbet-programs/programs/sol-bet/src/lib.rs:94
nullify_betResolveBetsolbet-programs/programs/sol-bet/src/lib.rs:103
claim_winningsClaimWinningssolbet-programs/programs/sol-bet/src/lib.rs:109

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
back.jsPublicKey, Transaction, ComputeBudgetProgram, getAssociatedTokenAddress, Keypair, sendAndConfirmTransaction
solbet-programs/programs/sol-bet/src/lib.rsseeds, Pubkey, CpiContext, Program, transfer
pages/api/create-payment-link.tsConnection, PublicKey, Keypair
solbet-programs/migrations/deploy.tsProgram, PublicKey, Keypair
solbet-programs/tests/sol-bet.tsProgram, AnchorProvider
pages/api/pay.tsPublicKey

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/dapp-wif-hat/. 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 dev
.npm run start
solbet-programsnpm run lint
solbet-programsanchor build
solbet-programsanchor test
solbet-programsanchor run test

What you could build from it