Sol.College

Full lesson

GhBounty

Automated GitHub bounty marketplace with AI-verified PRs. Opus analyzes, GenLayer juries on-chain, humans pick the winner. Solana-first, agent-native via x402 + MCP.

What it does

From the project README:

Ghbounty is a bounty platform for GitHub issues where **companies post bounties, developers (human or AI) submit PRs, and an automated evaluation pipeline decides the ranking**. Final winner selection is always human.
Original
Ghbounty/GhBounty
SuperStack fork
Blockchains/GhBounty @ 2c12467
Stars
1
Last push (original)
2026-05-21
Languages
TypeScript, CSS, Rust, PLpgSQL, Python, JavaScript
Detected stack
@solana/kitAnchorNext.jsweb3.js
Categories
AI & Agents
Licence
MIT
Homepage
https://gh-bounty-frontend.vercel.app

Architecture

272 source files. By extension: .ts ×200, .tsx ×60, .rs ×6, .py ×5, .js ×1.

Top-level directorySource files
frontend130
packages55
apps41
relayer33
contracts6
bounty_judge5
scripts2

On-chain programs: contracts/solana/programs/ghbounty_escrow

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/ghbounty/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

Ghbounty/GhBounty · contracts/solana/programs/ghbounty_escrow/src/lib.rs L145–168 @ 2c12467 · MIT · original
    pub fn init_stake_deposit(        ctx: Context<InitStakeDeposit>,        amount: u64,    ) -> Result<()> {        require!(amount >= MIN_STAKE_LAMPORTS, EscrowError::StakeTooSmall);         let stake = &mut ctx.accounts.stake;        stake.owner = ctx.accounts.owner.key();        stake.amount = amount;        stake.status = StakeStatus::Active;        stake.created_at = Clock::get()?.unix_timestamp;        stake.locked_until = stake.created_at + STAKE_LOCK_SECONDS;        stake.bump = ctx.bumps.stake;         // Transfer lamports from owner to the stake PDA.        invoke(            &system_instruction::transfer(                &ctx.accounts.owner.key(),                &stake.key(),                amount,            ),            &[                ctx.accounts.owner.to_account_info(),                stake.to_account_info(),
  1. Line 149 require!(amount >= MIN_STAKE_LAMPORTS, EscrowError::StakeTooSmall);: An explicit validation that aborts the instruction with an error.
  2. Line 151 let stake = &mut ctx.accounts.stake;: Touches staking state: the amount locked and when it was locked.
  3. Line 155 stake.created_at = Clock::get()?.unix_timestamp;: Reads on-chain time from the Clock sysvar.
  4. Line 157 stake.bump = ctx.bumps.stake;: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  5. Line 160 invoke(: Makes a cross-program invocation into another program.
Ghbounty/GhBounty · frontend/lib/solana.ts L433–456 @ 2c12467 · MIT · original
    })    .instruction();} /* ================================================================ * GHB-188: init_stake_deposit helpers (MCP account activation) * ================================================================ */ /** * Derive the stake-deposit PDA. Mirrors the on-chain seeds *   seeds = [STAKE_DEPOSIT_SEED, owner.key().as_ref()] * so callers can compute the address before sending the tx. * * The PDA is one-per-owner; trying to init a second time fails with * Anchor's "account already exists" error. */export function deriveStakeDepositPda(owner: PublicKey): [PublicKey, number] {  return PublicKey.findProgramAddressSync(    [STAKE_DEPOSIT_SEED, owner.toBuffer()],    PROGRAM_ID,  );} /**
  1. Line 442 * Derive the stake-deposit PDA. Mirrors the on-chain seeds: Touches staking state: the amount locked and when it was locked.
  2. Line 443 * seeds = [STAKE_DEPOSIT_SEED, owner.key().as_ref()]: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  3. Line 450 return PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.

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 buildpnpm -r build
.npm run testpnpm -r test
.npm run lintpnpm -r lint
relayernpm run devtsx watch src/index.ts
relayernpm run starttsx src/index.ts
relayernpm run buildtsc
relayernpm run testvitest run
apps/mcpnpm run devnext dev --port 3001
apps/mcpnpm run startnext start --port 3001
apps/mcpnpm run buildnext build
apps/mcpnpm run testvitest run
frontendnpm run devnext dev
frontendnpm run startnext start
frontendnpm run buildnext build
frontendnpm run testvitest run
frontendnpm run linteslint

What you could build from it

Used in lessons