Sol.College

Structure lesson (licence does not allow quoting code)

Beaver402

Original
emirykl/Beaver402
SuperStack fork
Blockchains/Beaver402 @ 47c9987
Stars
0
Last push (original)
2026-10-22
Languages
TypeScript, Rust, CSS, Shell, HTML, JavaScript
Detected stack
@solana/kitAnchor
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

124 source files. By extension: .ts ×92, .rs ×26, .tsx ×5, .js ×1.

Top-level directorySource files
backend86
solana16
frontend12
contracts10

On-chain programs: solana/programs/beaver402_policy

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
initializeInitializesolana/programs/beaver402_policy/src/lib.rs:86
payPaysolana/programs/beaver402_policy/src/lib.rs:128
freeze_paymentsOwnerActionsolana/programs/beaver402_policy/src/lib.rs:272
restore_paymentsOwnerActionsolana/programs/beaver402_policy/src/lib.rs:290
revoke_agent_signerOwnerActionsolana/programs/beaver402_policy/src/lib.rs:305
set_agent_signerOwnerActionsolana/programs/beaver402_policy/src/lib.rs:319
add_merchantOwnerActionsolana/programs/beaver402_policy/src/lib.rs:332
remove_merchantOwnerActionsolana/programs/beaver402_policy/src/lib.rs:349
reduce_limitsOwnerActionsolana/programs/beaver402_policy/src/lib.rs:365
recover_fundsRecoverFundssolana/programs/beaver402_policy/src/lib.rs:390

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
solana/programs/beaver402_policy/tests/common/mod.rsPubkey, Keypair, Transaction, Program
solana/programs/beaver402_policy/src/lib.rsPubkey, seeds, Program, transfer, CpiContext
solana/programs/beaver402_policy/src/state.rsPubkey
solana/programs/beaver402_policy/tests/policy.rsKeypair, Transaction, Pubkey
solana/programs/beaver402_policy/tests/accounts.rsPubkey, Keypair
backend/tests/solana.test.tsKeypair, Program, Transaction, invoke, transfer
backend/scripts/solana-init.tsKeypair, signTransaction, getLatestBlockhash, sendTransaction, getAccountInfo, getBalance
solana/programs/beaver402_policy/tests/owner.rsKeypair, Pubkey
backend/src/chains/solana/owner-actions.tssignTransaction, Keypair, getAccountInfo, getLatestBlockhash, sendTransaction
backend/src/chains/solana/settlement.tsTransaction, transfer, sendTransaction
solana/programs/beaver402_policy/tests/introspection.rsKeypair, Pubkey
solana/programs/beaver402_policy/tests/vectors.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/beaver402/. 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
backendnpm run dev
backendnpm run build
backendnpm run test
frontendnpm run dev
frontendnpm run build
solanaanchor build
solanaanchor test
solanaanchor run test
.cargo build
.cargo test

What you could build from it