Sol.College

Structure lesson (licence does not allow quoting code)

Merdan_Sol_1Q24

Original
Web3-Builders-Alliance/Merdan_Sol_1Q24
SuperStack fork
Blockchains/Merdan_Sol_1Q24 @ 682bc82
Stars
0
Last push (original)
2024-04-07
Languages
Rust, JavaScript, TypeScript, CSS
Detected stack
AnchorNext.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

31 source files. By extension: .rs ×14, .js ×11, .ts ×6.

Top-level directorySource files
capstone11
amm9
escrow8
vault3

On-chain programs: amm/programs/amm, escrow/programs/escrow, vault/programs/vault

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
initialize_ammInitamm/programs/amm/src/lib.rs:17
initializeInitializeescrow/programs/escrow/src/lib.rs:14
makeMakeescrow/programs/escrow/src/lib.rs:23
refundRefundescrow/programs/escrow/src/lib.rs:28
takeTakeescrow/programs/escrow/src/lib.rs:32
initializeInitializevault/programs/vault/src/lib.rs:12
depositDepositvault/programs/vault/src/lib.rs:21
cancelCancelvault/programs/vault/src/lib.rs:32
withdrawWithdrawvault/programs/vault/src/lib.rs:47

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/vault/src/lib.rsseeds, Program, CpiContext, transfer, has_one, Pubkey
escrow/tests/anchor-escrow.tsSystemProgram, getAssociatedTokenAddressSync, Program, Keypair, PublicKey, Transaction
escrow/programs/escrow/src/contexts/take.rstransfer, Program, CpiContext, init_if_needed, seeds, has_one
amm/programs/amm/src/contexts/withdraw.rsseeds, init_if_needed, Program, CpiContext
amm/programs/amm/src/contexts/deposit.rsseeds, CpiContext, Program, init_if_needed
amm/programs/amm/src/contexts/swap.rsseeds, Program, CpiContext, init_if_needed
escrow/programs/escrow/src/contexts/refund.rsProgram, transfer, CpiContext, has_one, seeds
escrow/programs/escrow/src/contexts/make.rsProgram, transfer, seeds, CpiContext
capstone/maindocs/Pages/tx-history.jsTransaction, useWallet
amm/programs/amm/src/contexts/init.rsseeds, Program
amm/programs/amm/src/state.rsPubkey
amm/tests/amm.tsProgram, AnchorProvider

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/merdan-sol-1q24/. 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
capstone/maindocsnpm run dev
capstone/maindocsnpm run start
capstone/maindocsnpm run build
capstone/maindocsnpm run lint
ammnpm run lint
escrownpm run lint
vaultnpm run lint
ammanchor build
ammanchor test
ammanchor run test
escrowanchor build
escrowanchor test
escrowanchor run test
vaultanchor build
vaultanchor test
vaultanchor run test

What you could build from it