feat(bounty): winner selection + payout (#633)#669
Conversation
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.
|
@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…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>
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_winnersop that pays out on-chain.selections: [{ applicantAddress, position }], drivesuseEscrowOpRunner(organizer scope; MANAGED signs server-side, EXTERNAL via wallet kit) with a progress state, then a success state with the payout tx link.useBountyPayouthook — mirrorsuseBountyPublish; 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
select-winnersescrow client/hook.