Sol.College

Structure lesson (licence does not allow quoting code)

HashFox-app

Complete hashfox app for any markets

Original
HashFoxLabs/HashFox-app
SuperStack fork
Blockchains/HashFox-app @ d136b0a
Stars
0
Last push (original)
2026-05-28
Languages
Svelte, TypeScript, Rust, JavaScript, HTML
Detected stack
AnchorMetaplexweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

63 source files. By extension: .ts ×61, .rs ×1, .js ×1.

Top-level directorySource files
frontend62
contracts1

On-chain programs: contracts/programs/hashfox

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_configInitializeConfigcontracts/programs/hashfox/src/lib.rs:244
add_executorUpdateExecutorscontracts/programs/hashfox/src/lib.rs:257
remove_executorUpdateExecutorscontracts/programs/hashfox/src/lib.rs:268
cancel_limit_orderUserTradingActioncontracts/programs/hashfox/src/lib.rs:389
fill_limit_orderExecutorTradingActioncontracts/programs/hashfox/src/lib.rs:414
execute_tp_slExecutorTradingActioncontracts/programs/hashfox/src/lib.rs:419
liquidate_positionExecutorTradingActioncontracts/programs/hashfox/src/lib.rs:428
migrate_user_accountMigrateUserAccountcontracts/programs/hashfox/src/lib.rs:558
join_competitionJoinCompetitioncontracts/programs/hashfox/src/lib.rs:655
report_scoreReportScorecontracts/programs/hashfox/src/lib.rs:741
settle_competitionSettleCompetitioncontracts/programs/hashfox/src/lib.rs:768
claim_competition_exitClaimCompetitionExitcontracts/programs/hashfox/src/lib.rs:884
admin_force_start_competitionAdminCompetitionActioncontracts/programs/hashfox/src/lib.rs:909
admin_refund_participantAdminRefundParticipantcontracts/programs/hashfox/src/lib.rs:940
admin_close_competitionAdminCloseCompetitioncontracts/programs/hashfox/src/lib.rs:994
comp_cancel_limit_orderCompUserTradingActioncontracts/programs/hashfox/src/lib.rs:1098

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
contracts/programs/hashfox/src/lib.rsPubkey, seeds, Program, transfer, CpiContext, has_one
frontend/src/lib/hashfox.tsPublicKey, SystemProgram, Connection, Transaction, findProgramAddressSync, Program
frontend/src/lib/competition.tsPublicKey, SystemProgram, findProgramAddressSync, getProgramAccounts
frontend/src/lib/solana/session-keys.tsPublicKey, Transaction, Keypair, signTransaction, SystemProgram, Connection
frontend/src/lib/hashfoxClient.tsPublicKey, signTransaction, Connection, findProgramAddressSync, getAccountInfo, SystemProgram
frontend/src/routes/api/embedded-airdrop/+server.tsKeypair, PublicKey, Connection, SystemProgram, Transaction, transfer
frontend/src/lib/wallet/stores.tsConnection, Transaction, signTransaction, PublicKey
frontend/src/lib/solana/connection.tsConnection, AnchorProvider, Transaction
frontend/src/lib/wallet/web3auth.tsPublicKey, signTransaction, sendTransaction
frontend/src/routes/galxe/has-account/+server.tsPublicKey, findProgramAddressSync, getAccountInfo
frontend/src/lib/stores/activeCompetition.tsPublicKey
frontend/src/lib/profile/mintCard.tscreateUmi, mplTokenMetadata, Connection

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/hashfox-app/. 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 build
frontendnpm run dev
frontendnpm run build
contractsanchor build
contractsanchor test
contractsanchor run test

What you could build from it