Skip to content

Prevent Self-Referral Reward Exploits #129

@hman38705

Description

@hman38705

issues : 21

Great issue: Prevent Self-Referral Reward Exploits

Description
The referrer parameter in the place_bet function is accepted without any identity verification. This allows a malicious bettor to provide their own secondary address (or even the same address) as a referrer for every bet, effectively gaining a systematic discount on all protocol fees and draining the referral pool intended for actual promoters.

Requirements and context

  • Add a strict requirement check: require!(referrer != bettor).
  • Consider implementing a "Referrer Whitelist" or verification system for high-volume accounts.

Suggested execution

  • Fork the repo and create a branch: git checkout -b fix/issue-21-self-referral
  • Update the betting authorization logic.

Implementation changes

  • Modify bets.rs (around line 19) to validate the bettor and referrer are distinct entities.

Test and commit

  • Verify that a bet attempt where referrer == bettor results in an immediate transaction failure.

Example commit message
fix: prevent bettors from referring themselves to claim fee discounts

Guidelines

  • Economic integrity of the referral system.
  • Timeframe: 24 hours.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions