Skip to content

feat: add referral fee routing, per-wallet cap, airdrop improvements,… - #594

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
gelluisaac:build
Jul 25, 2026
Merged

Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
gelluisaac:build

Conversation

@gelluisaac

Copy link
Copy Markdown
Contributor

… and discount tiers

closes #514 : Add referral fee routing on buy so referrers earn a share of the protocol fee

  • Add referrer: Option parameter to buy_key (via buy_key_with_referrer internal fn)
  • Split protocol fee: 80% treasury, 20% referrer (configurable bps)
  • Self-referral reverts with InvalidReferrer
  • Emit ReferralFeeEarned { creator_id, buyer, referrer, amount, ledger }
  • Add get_referral_fee_bps() and set_referral_fee_bps() admin function

closes #515 : Add per-wallet key holding cap

  • Enforce max_keys_per_wallet on buy and transfer
  • Add get_wallet_cap(creator_id) -> Option view function
  • Cap is immutable after registration

closes #523 : Add creator key airdrop (pre-existing, enhanced with per-wallet cap checks)

  • Recipients at their wallet cap are skipped, not reverted
  • Creator fee waived; protocol fee applies to total
  • KeysAirdropped event with summary fields

closes #522 Add discount tiers and creator volume

  • Add DiscountTier { threshold, protocol_bps } struct
  • Add update_discount_tiers(admin, tiers) admin function (max 5 tiers)
  • Add get_discount_tiers() view function
  • Add get_creator_volume(creator_id) view function

… and discount tiers

accesslayerorg#514: Add referral fee routing on buy so referrers earn a share of the protocol fee
- Add referrer: Option parameter to buy_key (via buy_key_with_referrer internal fn)
- Split protocol fee: 80% treasury, 20% referrer (configurable bps)
- Self-referral reverts with InvalidReferrer
- Emit ReferralFeeEarned { creator_id, buyer, referrer, amount, ledger }
- Add get_referral_fee_bps() and set_referral_fee_bps() admin function

accesslayerorg#515: Add per-wallet key holding cap
- Enforce max_keys_per_wallet on buy and transfer
- Add get_wallet_cap(creator_id) -> Option view function
- Cap is immutable after registration

accesslayerorg#523: Add creator key airdrop (pre-existing, enhanced with per-wallet cap checks)
- Recipients at their wallet cap are skipped, not reverted
- Creator fee waived; protocol fee applies to total
- KeysAirdropped event with summary fields

Add discount tiers and creator volume
- Add DiscountTier { threshold, protocol_bps } struct
- Add update_discount_tiers(admin, tiers) admin function (max 5 tiers)
- Add get_discount_tiers() view function
- Add get_creator_volume(creator_id) view function
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@gelluisaac Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 4d3e8de into accesslayerorg:main Jul 25, 2026
1 check passed
@gelluisaac
gelluisaac deleted the build branch July 25, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants