Skip to content

[Giveaway] Replace public distribution with winner claim lifecycle #405

Description

@3m1n3nc3

Description

The README describes a winner claim flow, but the current contract exposes distribute_prize() and sends the prize directly once the giveaway becomes claimable. Add an explicit winner-driven claim flow with clearer lifecycle semantics.

User Story

As a Winner,
I want to claim my prize explicitly,
so that giveaway completion matches the product flow and supports future claim windows or proof steps.

Requirements and Context

  • Files / refs: contracts/geev-core/src/giveaway.rs, contracts/geev-core/src/test.rs, contracts/README.md
  • Add claim_prize behavior that requires winner authentication
  • Distinguish winner selection from prize claiming in status transitions
  • Migrate or replace the current distribute_prize() path with explicit claim semantics
  • Preserve fee accounting and reputation updates

Suggested Implementation

1. Keep pick_winner focused on selecting the winner and setting Claimable state
2. Add claim_prize(winner, giveaway_id)
3. Require winner auth before transferring net prize
4. Mark giveaway Completed only after successful claim

Acceptance Criteria

  • Only the selected winner can claim the prize
  • Winner selection and payout are separate contract actions
  • Fee accounting and reputation updates still occur on successful payout

Submission Guidelines

  • Branch: feat/giveaway-claim-flow
  • Depends on: None
  • PR: feat(giveaway): add explicit winner claim lifecycle

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions