Skip to content

Commit bceb99e

Browse files
authored
feat(bounty): allow up to 15 competition prize tiers (#683)
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.
1 parent f7e4463 commit bceb99e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

components/organization/bounties/new/tabs/schemas/modeSchema.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type BountyClaimType = (typeof CLAIM_TYPES)[number];
2121
export type BountySubmissionVisibility =
2222
(typeof SUBMISSION_VISIBILITIES)[number];
2323

24-
export const MAX_PRIZE_TIERS = 3;
24+
export const MAX_PRIZE_TIERS = 15;
2525

2626
/** Whether a contributor applies before working. */
2727
export const isApplicationEntry = (entryType: BountyEntryType): boolean =>
@@ -140,7 +140,8 @@ export const modeSchema = z
140140
.object({
141141
entryType: z.enum(ENTRY_TYPES),
142142
claimType: z.enum(CLAIM_TYPES),
143-
// Number of prize positions. 1 for single claim; 1-3 for a competition.
143+
// Number of prize positions. 1 for single claim; 1..MAX_PRIZE_TIERS for a
144+
// competition.
144145
winnerCount: z.number().int().min(1).max(MAX_PRIZE_TIERS).default(1),
145146
})
146147
.superRefine((data, ctx) => {
@@ -157,7 +158,7 @@ export const modeSchema = z
157158
) {
158159
ctx.addIssue({
159160
code: z.ZodIssueCode.custom,
160-
message: 'A competition pays 1 to 3 winners',
161+
message: `A competition pays 1 to ${MAX_PRIZE_TIERS} winners`,
161162
path: ['winnerCount'],
162163
});
163164
}

0 commit comments

Comments
 (0)