Skip to content

[Contracts] Add manual or merit-based winner selection #312

Description

@Kaylahray

Description

The contracts README lists merit-based and manual selection as future giveaway modes, but the current implementation only supports a random winner path.

User Story

As a creator,
I want to choose winners manually or by merit,
so that I can run campaigns that are not purely random.

Requirements and Context

  • Files: contracts/geev-core/src/types.rs, contracts/geev-core/src/giveaway.rs, contracts/geev-core/src/test.rs
  • Add a selection mode for manual and merit-based winner resolution
  • Validate that only the creator or authorized admin can finalize the result
  • Keep the existing random flow available for default giveaways

Suggested Implementation

// SELECTION MODES
// 1. Add a selection_method field to giveaway state.
// 2. Support manual winner assignment and merit-based sorting.
// 3. Gate each mode with appropriate authorization.
// 4. Emit the same lifecycle events for downstream indexing.

Acceptance Criteria

  • A giveaway can be finalized manually when configured.
  • Merit-based selection can be enabled without breaking random selection.
  • Unauthorized callers cannot change the winner.

Submission Guidelines

  • Branch: feat/manual-merit-selection
  • Depends on: giveaway state model
  • PR: feat(contracts): add manual and merit-based winner selection

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions