How rishi2600/openbounty-v2 works
OpenBounty is a Solana bounty application: organizers create funded, tiered bounties; judges vote for winners; winners claim prizes and organizers can reclaim unclaimed prizes after the deadline. The frontend also supports bounty discovery, role-specific task views, market/news information, and submission/judging screens. The principal create-and-settle flow is represented alongside those documented UI capabilities. Sampled hooks and program entry points ground the transaction and read edges; several unsampled page/component connections are omitted where wiring is uncertain.
Main entry points: lib.rs Program instructions · MyBounties.tsx Role tasks · useAllEscrows.ts Escrow listing · useEscrow.ts Escrow lookup
Components 34
Frontend experience
- App shell
offchain/app/layout.tsx - Create page
offchain/app/create/page.tsx - Bounty form
offchain/src/components/create/CreateBountyForm.tsx - Bounty detail
offchain/app/bounty/[address]/page.tsx - Detail panels
offchain/src/components/bounty/BountyDetail.tsx - Bounty discovery
offchain/src/components/explore/ExploreBounties.tsx - Markets
offchain/app/markets/page.tsx - Market charts
offchain/src/components/markets/MarketsView.tsx - My bounties
offchain/app/me/page.tsx - Role tasks
offchain/src/components/me/MyBounties.tsx - Judging board
offchain/src/components/judging/JudgingBoard.tsx - Entries gallery
offchain/src/components/submissions/SubmissionGallery.tsx - News feed
offchain/src/components/news/NewsFeed.tsx
Client data and actions
- Wallet context
offchain/src/components/WalletProvider.tsx - Create transaction
offchain/src/hooks/useCreateBounty.ts - Vote claim refund
offchain/src/hooks/useBountyActions.ts - Escrow listing
offchain/src/hooks/useAllEscrows.ts - Escrow lookup
offchain/src/hooks/useEscrow.ts - Task classification
offchain/src/utils/tasks.ts - Market queries
offchain/src/hooks/useMarketQuotes.ts - Entry handling
offchain/src/hooks/useSubmissions.ts - Anchor client
offchain/src/hooks/useProgram.ts
Solana program
- Escrow account
onchain/programs/openbounty_v2/src/state/escrow.rs - Program instructions
onchain/programs/openbounty_v2/src/lib.rs - Initialize escrow
onchain/programs/openbounty_v2/src/instructions/initialize.rs - Finalize winner
onchain/programs/openbounty_v2/src/instructions/vote.rs - Prize claim
onchain/programs/openbounty_v2/src/instructions/claim.rs - Unclaimed refund
onchain/programs/openbounty_v2/src/instructions/refund.rs
Preview integrations
- Mock bounty data
offchain/src/mocks/store.ts - Mock entries
offchain/src/mocks/actions.ts - News data
offchain/src/mocks/news.ts
Other components
- Bounty user
- Solana network
- Market data source
Connections 44
- Bounty user → App shell: uses app
- App shell → Wallet context: provides wallet
- Bounty user → Create page: opens create
- Create page → Bounty form: renders form
- Bounty form → Create transaction: submits values
- Create transaction → Anchor client: gets client
- Create transaction → Solana network: sends initialize
- Solana network → Program instructions: dispatches instruction
- Program instructions → Initialize escrow: calls initialize
- Initialize escrow → Escrow account: creates escrow
- Bounty user → Bounty detail: opens bounty
- Bounty detail → Detail panels: renders details
- Bounty detail → Escrow lookup: loads address
- Escrow lookup → Anchor client: gets client
- Escrow lookup → Solana network: fetches account
- Solana network → Escrow lookup: returns escrow
- Detail panels → Vote claim refund: requests action
- Vote claim refund → Solana network: sends vote claim refund
- Solana network → Program instructions: dispatches instruction
- Program instructions → Finalize winner: calls vote
- Program instructions → Prize claim: calls claim
- Program instructions → Unclaimed refund: calls refund
- Finalize winner → Escrow account: updates votes
- Prize claim → Escrow account: marks claimed
- Unclaimed refund → Escrow account: updates escrow
- Bounty user → Bounty discovery: browses bounties
- Bounty discovery → Escrow listing: loads listings
- Escrow listing → Solana network: reads accounts
- Escrow listing → Mock bounty data: loads previews
- Bounty user → My bounties: opens tasks
- My bounties → Role tasks: renders tasks
- Role tasks → Escrow listing: loads bounties
- Role tasks → Task classification: classifies roles
- Task classification → Role tasks: returns task groups
- Bounty user → Markets: opens markets
- Markets → Market charts: renders charts
- Market charts → Market queries: requests quotes
- Market queries → Market data source: fetches market data
- Judging board → Vote claim refund: casts vote
- Detail panels → Entries gallery: shows entries
- Entries gallery → Entry handling: loads and submits
- Entry handling → Mock entries: uses preview actions
- Entry handling → Mock bounty data: reads preview entries
- News feed → News data: reads feed