Skip to content

Proportional Fee Distribution to Multiple Platforms #521

Description

@Kingsman-99

Description

The platform currently routes all collected fees to a single address. For partner integrations, fees should be distributable across multiple platform addresses in configurable proportions, paid out at invoice finalisation.

Technical Context

Replace FeeRecipient: Address with FeeRecipients: Vec<(Address, u32)> (address, basis-point share) in storage::instance inside contracts/split/src/lib.rs. Define a FeeSplit struct in types.rs. Validate that fee recipient basis points sum to 10 000. Loop through recipients during payout and transfer each their proportional fee share.

Acceptance Criteria

  • Fee is split proportionally across all registered fee recipients at payout time
  • set_fee_recipients validates that shares sum to exactly 10 000 basis points
  • A single fee recipient with 10 000 basis points behaves identically to the old single-recipient model
  • Empty fee recipient list defaults to no fee deduction
  • FeeRecipientsUpdated(recipients) event is emitted from events.rs on change
  • All CI checks (cargo build --target wasm32-unknown-unknown, cargo test, cargo clippy) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions