Sol.College

Structure lesson (licence does not allow quoting code)

Sol_Pack

Herein lies my Sol's Proof-of-History

Original
ogunbor/Sol_Pack
SuperStack fork
Blockchains/Sol_Pack @ b795072
Stars
0
Last push (original)
2024-10-03
Languages
TypeScript, Rust, JavaScript, CSS, HTML
Detected stack
AnchorMetaplexweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

112 source files. By extension: .rs ×60, .ts ×44, .jsx ×5, .js ×3.

Top-level directorySource files
sol-trust23
nft-staking-conventional14
marketplace-anchor11
dice-game-anchor10
staking10
amm9
cluster19
escrow8

On-chain programs: amm/programs/solana_amm, dice-game-anchor/programs/dice-game-anchor, escrow/programs/escrow, marketplace-anchor/programs/market-place, nft-staking-conventional/programs/nft-staking-conventional, sol-trust/programs/bank-rewards, sol-trust/programs/rewards-bank, sol-trust/programs/sol-trust

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
initializeInitializemarketplace-anchor/programs/market-place/src/lib.rs:16
listListmarketplace-anchor/programs/market-place/src/lib.rs:20
delistDelistmarketplace-anchor/programs/market-place/src/lib.rs:25
purchasePurchasemarketplace-anchor/programs/market-place/src/lib.rs:29
initializeInitializedice-game-anchor/programs/dice-game-anchor/src/lib.rs:16
place_betPlaceBetdice-game-anchor/programs/dice-game-anchor/src/lib.rs:20
resolve_betResolveBetdice-game-anchor/programs/dice-game-anchor/src/lib.rs:25
refund_betRefundBetdice-game-anchor/programs/dice-game-anchor/src/lib.rs:30
initialize_userInitializenft-staking-conventional/programs/nft-staking-conventional/src/lib.rs:25
stakeStakenft-staking-conventional/programs/nft-staking-conventional/src/lib.rs:29
unstakeUnstakenft-staking-conventional/programs/nft-staking-conventional/src/lib.rs:33
claimClaimnft-staking-conventional/programs/nft-staking-conventional/src/lib.rs:37
stakeStakestaking/anchor/programs/core-rust-staking-example/src/lib.rs:18
unstakeStakestaking/anchor/programs/core-rust-staking-example/src/lib.rs:101
makeMakeescrow/programs/escrow/src/lib.rs:15
refundRefundescrow/programs/escrow/src/lib.rs:20
takeTakeescrow/programs/escrow/src/lib.rs:24
initializeInitializesol-trust/programs/bank-rewards/src/lib.rs:11
depositDepositsol-trust/programs/bank-rewards/src/lib.rs:15
withdrawWithdrawsol-trust/programs/bank-rewards/src/lib.rs:19
initializeInitializesol-trust/programs/rewards-bank/src/lib.rs:13
depositDepositsol-trust/programs/rewards-bank/src/lib.rs:17
withdrawWithdrawsol-trust/programs/rewards-bank/src/lib.rs:22
initializeInitializesol-trust/programs/sol-trust/src/lib.rs:17
depositDepositsol-trust/programs/sol-trust/src/lib.rs:22
premature_closePrematureClosesol-trust/programs/sol-trust/src/lib.rs:27
mature_closeMatureClosesol-trust/programs/sol-trust/src/lib.rs:32
rewardsRewardssol-trust/programs/sol-trust/src/lib.rs:37
initializeInitializevault/programs/anchor_vault_q3_2024/src/lib.rs:12
depositDepositvault/programs/anchor_vault_q3_2024/src/lib.rs:17

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
vault/programs/anchor_vault_q3_2024/src/lib.rsseeds, transfer, Program, CpiContext
dice-game-anchor/tests/dice-game-anchor.tsSystemProgram, Keypair, PublicKey, Program, Transaction, sendAndConfirmTransaction
sol-trust/tests/sol-trust.tsSystemProgram, PublicKey, Keypair, Program, findProgramAddressSync, requestAirdrop
prereq/transfer.tstransfer, SystemProgram, Transaction, Connection, Keypair, sendAndConfirmTransaction
marketplace-anchor/programs/market-place/src/contexts/purchase.rsseeds, CpiContext, transfer, Program, init_if_needed
escrow/tests/escrow.tsSystemProgram, getAssociatedTokenAddressSync, Program, Keypair, PublicKey, Transaction
cluster1/vault_deposit_nft.tsPublicKey, Connection, Keypair, Program, AnchorProvider, findProgramAddressSync
cluster1/vault_withdraw_nft.tsPublicKey, Connection, Keypair, Program, AnchorProvider, findProgramAddressSync
sol-trust/programs/rewards-bank/src/lib.rsseeds, Program, CpiContext, Pubkey, transfer
sol-trust/programs/bank-rewards/src/lib.rsseeds, transfer, Program, CpiContext
nft-staking-conventional/programs/nft-staking-conventional/src/instructions/stake.rsseeds, Program, CpiContext, invoke_signed
nft-staking-conventional/programs/nft-staking-conventional/src/instructions/unstake.rsseeds, Program, invoke_signed, CpiContext

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/sol-pack/. 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
marketplace-anchornpm run lint
dice-game-anchornpm run lint
nft-staking-conventionalnpm run lint
ammnpm run lint
staking/anchornpm run lint
escrownpm run lint
sol-trustnpm run lint
sol-trust/appnpm run dev
sol-trust/appnpm run build
sol-trust/appnpm run lint
vaultnpm run lint
marketplace-anchoranchor build
marketplace-anchoranchor test
marketplace-anchoranchor run test
dice-game-anchoranchor build
dice-game-anchoranchor test

What you could build from it