Skip to content

feat(bounty): winner selection + payout (#633)#669

Merged
0xdevcollins merged 6 commits into
boundlessfi:feat/t-replacefrom
Benjtalkshow:feat/bounty-winner-payout
Jul 5, 2026
Merged

feat(bounty): winner selection + payout (#633)#669
0xdevcollins merged 6 commits into
boundlessfi:feat/t-replacefrom
Benjtalkshow:feat/bounty-winner-payout

Conversation

@Benjtalkshow

Copy link
Copy Markdown
Collaborator

Closes #633. Part of the Bounty Operate to Payout milestone (#638). Stacked on #668 (#632) → #667 (#630) — merge those first; until then the diff shows their commits too. The new logic here is the Payout tab + payout hook.

What

Fills the management dashboard's Payout & Winners tab — the organizer picks winner(s) per prize tier and triggers the single select_winners op that pays out on-chain.

  • Winner assignment — one selector per prize tier (1st/2nd/3rd, sorted). Single-claim shows one tier; competition shows all. A submission can only win one tier (assigned ones drop from the other selectors). Only anchored (active) submissions are eligible.
  • Payout — builds selections: [{ applicantAddress, position }], drives useEscrowOpRunner (organizer scope; MANAGED signs server-side, EXTERNAL via wallet kit) with a progress state, then a success state with the payout tx link.
  • Completed state — an already-completed bounty shows the recorded winners (tier + amount) instead of the picker.
  • Visibility gate — competition winner selection opens at the deadline.
  • useBountyPayout hook — mirrors useBountyPublish; on settle the backend pushes USDC, marks winners, and flips the bounty to COMPLETED automatically.

Verification

tsc 0 errors, eslint clean. The on-chain payout itself is validated end-to-end on testnet (needs a bounty with anchored submissions + the funded managed wallet).

Notes

Regenerate the OpenAPI schema against v2 to pull the new organizer DTOs
(BountyOperateOverviewDto, OrganizerBountySubmissionDto,
BountyAnnouncementDto, etc.). Drop applicationCreditCost from the bounty
publish request body; the backend removed it from PublishBountyEscrowDto
and now applies it server-side from the draft.
Add the per-bounty organizer management hub at
/organizations/[id]/bounties/[bountyId]: a tabbed shell (Overview,
mode-aware Applications, Submissions, Payout & Winners, Settings) with the
status + mode header, and an Overview tab that consumes the operate-reads
endpoint (boundlessfi#338) for intake stats, deadlines, and prize tiers. Non-overview
tabs are placeholders for the follow-up issues (boundlessfi#631-boundlessfi#634).
Fill the management dashboard's Submissions tab: list submitted work from
the organizer submissions endpoint (boundlessfi#337) with submitter identity, status,
the content link plus documentation/tweet/demo/media, and submitted-at.
Respect submissionVisibility — competition work stays sealed (and unfetched)
until the deadline. Adds a client-side 'stage for payout' selection that
feeds winner selection (boundlessfi#633).
Fill the management dashboard's Payout & Winners tab: assign anchored
submissions to prize tiers (one winner per tier, single-claim = 1,
competition = 1-N), then drive the single select-winners escrow op
(useBountyPayout, organizer scope; MANAGED signs server-side, EXTERNAL via
wallet kit) with progress + payout tx link. On settle the bounty flips to
COMPLETED; already-completed bounties show recorded winners. Consumes the
submissions review (boundlessfi#632) staging.
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e6c8112d-30f3-4e16-856c-b50fce59a4f8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

0xdevcollins and others added 2 commits July 5, 2026 12:49
…s) into feat/bounty-winner-payout

Takes the base's reviewed versions of the shared dashboard/data-layer files
and ports the payout panel to the new useBountySubmissions options bag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
)

- require every prize tier to have a winner before payout: the on-chain
  select_winners op is one-shot and completion strands unpaid tiers' escrow
- add a review + confirm dialog before the irreversible payout (winner,
  address, amount per tier, total), matching publish/treasury precedent
- fetch the COMPLETE submission pool for winner selection
  (listAllBountySubmissions pages the capped endpoint) so late entrants are
  never invisible; the completed-state winner list uses it too
- exclude rejected and disputed submissions from eligibility, show review
  status in the picker, and hide submissions whose payout address is already
  assigned to another tier (backend rejects duplicate addresses)
- derive summary, request body, and total from one resolved-selections
  source so the footer can never promise more than the request sends
- build the tx link via getTransactionExplorerUrl (network-aware) instead of
  a hardcoded testnet URL
- share the sealed-until-deadline card + 30s deadline recheck
  (SealedUntilDeadline, useDeadlinePassed) with the submissions tab, so the
  payout gate opens live and a null deadline does not seal forever
- surface staged submissions from the Submissions tab first in each picker
- share ESCROW_PHASE_LABEL from features/bounties (submit form + payout)
- drop dead payoutResponse/hasStarted state in useBountyPayout and document
  the owner-address limitation (treasury-funded bounties need backend work)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@0xdevcollins 0xdevcollins merged commit 9950d1f into boundlessfi:feat/t-replace Jul 5, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants