Skip to content

Fee Collection Logic #16

@Kaylahray

Description

@Kaylahray

User Story

As the Platform,
I want to collect 1% of giveaways as revenue.

Description

Calculate and deduct a fee from the pot.


Files to Create/Edit

contracts/geev-core/src/
└── giveaway.rs

Functional Requirements

  • Math: fee = amount * 1%.
  • Accounting: net_prize = amount - fee.

Suggested Implementation

// IN FUNCTION: distribute_prize

// 1. Load 'fee_bps' from storage.
// 2. Calculate 'fee_amount'.
// 3. Transfer 'net_prize' to Winner.
// 4. Add 'fee_amount' to a 'CollectedFees' storage counter (do not transfer yet).

Acceptance Criteria

  • Winner gets Total - Fee.
  • Fee counter increases.

Submission Guidelines

  • Branch: feat/fees

Metadata

Metadata

Assignees

No one assigned

    Labels

    @geevapp/app/wave2Moving to the app repo, as the contracts repo was not accepted for Drips Wave 2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions