From d07293b1979c7ae96141ee5d5bb657b343436f10 Mon Sep 17 00:00:00 2001 From: Benjtalkshow Date: Wed, 8 Jul 2026 23:53:21 +0100 Subject: [PATCH] feat(bounty): allow up to 15 competition prize tiers Bump MAX_PRIZE_TIERS 3 -> 15. The winner distribution is derived from tier amounts and normalized to 100% by the shared builder (same path hackathons use to publish many winners on-chain), so the contract already supports more than 3 positions; the 3 was a product guard. --- .../organization/bounties/new/tabs/schemas/modeSchema.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/organization/bounties/new/tabs/schemas/modeSchema.ts b/components/organization/bounties/new/tabs/schemas/modeSchema.ts index 7e29acb9..78248c52 100644 --- a/components/organization/bounties/new/tabs/schemas/modeSchema.ts +++ b/components/organization/bounties/new/tabs/schemas/modeSchema.ts @@ -21,7 +21,7 @@ export type BountyClaimType = (typeof CLAIM_TYPES)[number]; export type BountySubmissionVisibility = (typeof SUBMISSION_VISIBILITIES)[number]; -export const MAX_PRIZE_TIERS = 3; +export const MAX_PRIZE_TIERS = 15; /** Whether a contributor applies before working. */ export const isApplicationEntry = (entryType: BountyEntryType): boolean => @@ -140,7 +140,8 @@ export const modeSchema = z .object({ entryType: z.enum(ENTRY_TYPES), claimType: z.enum(CLAIM_TYPES), - // Number of prize positions. 1 for single claim; 1-3 for a competition. + // Number of prize positions. 1 for single claim; 1..MAX_PRIZE_TIERS for a + // competition. winnerCount: z.number().int().min(1).max(MAX_PRIZE_TIERS).default(1), }) .superRefine((data, ctx) => { @@ -157,7 +158,7 @@ export const modeSchema = z ) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: 'A competition pays 1 to 3 winners', + message: `A competition pays 1 to ${MAX_PRIZE_TIERS} winners`, path: ['winnerCount'], }); }