Skip to content

fix(starterpack): skip self-referral to prevent fee leakage#292

Merged
bal7hazar merged 1 commit intomainfrom
fix/starterpack-self-referral
Mar 4, 2026
Merged

fix(starterpack): skip self-referral to prevent fee leakage#292
bal7hazar merged 1 commit intomainfrom
fix/starterpack-self-referral

Conversation

@broody
Copy link
Contributor

@broody broody commented Mar 4, 2026

Summary

  • When the Controller passes the buyer's own address as the referrer, the referral fee is deducted from the payment_receiver's share but stays on the buyer's account (self-transfer no-op)
  • This caused the game owner to receive base_price - referral_fee instead of the full base_price
  • Fix: skip referral fee calculation when ref_addr == payer

Test plan

  • Added test_sp_fees_self_referral_ignored — verifies creator gets full base_price when spender is passed as referrer
  • All 47 existing tests pass

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arcade Ready Ready Preview Mar 4, 2026 9:04pm
arcade-storybook Ready Ready Preview Mar 4, 2026 9:04pm

Request Review

When the Controller passes the buyer's own address as the referrer,
the referral fee was deducted from the payment_receiver's share but
stayed on the buyer's account (self-transfer). This caused the game
owner to receive less than expected.

Skip referral fee when ref_addr == payer so the owner gets the full
base_price.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bal7hazar bal7hazar merged commit b58ffc1 into main Mar 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants