Skip to content

Build invoice referral system #87

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Ecosystem growth depends on creators bringing other creators. This issue adds an optional referrer: Option<Address> field to create_invoice() stored on-chain, and a get_referral_count() view function counting how many invoices a given address has referred — enabling off-chain referral reward programs.

Technical Context

Involves types.rs (add referrer: Option<Address>) and lib.rs. After saving the invoice, if referrer is Some, increment persistent key ("ref_count", referrer) by 1. Add get_referral_count(env, referrer: Address) -> u64 returning stored count or 0.

Acceptance Criteria

  • create_invoice() accepts optional referrer address
  • Referral count incremented for referrer on each invoice creation
  • get_referral_count() returns correct count for address with multiple referrals
  • Returns 0 for address with no referrals
  • referrer = None produces identical behaviour to current implementation
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions