Skip to content

Add per-wallet key holding cap so creators can prevent supply concentration #515

Description

@Chucks1093

Summary

Without a per-wallet cap, a single wallet can buy a majority of a creator's keys, dominating the price and locking out genuine fans. Letting creators set a maximum number of keys any single wallet can hold at registration gives communities a fairer distribution from the start.

Scope

  • Add optional max_keys_per_wallet: Option<u32> parameter to register_creator
  • At the start of buy, check if current_holder_balance + amount > max_keys_per_wallet and revert with WalletCapExceeded if so
  • Cap applies to each individual buy; the check is against the post-buy balance
  • Peer-to-peer transfers are also subject to the cap — receiving a transfer that would breach the cap reverts with WalletCapExceeded
  • Add get_wallet_cap(creator_id) -> Option<u32> view function
  • Cap is immutable after registration
  • None means no per-wallet limit (current default behavior)

Acceptance Criteria

  • Buy that would exceed per-wallet cap reverts with WalletCapExceeded
  • Buy up to exactly the cap succeeds
  • Transfer that would exceed cap reverts with WalletCapExceeded
  • get_wallet_cap returns None for uncapped creators
  • No per-wallet limit when None passed at registration
  • Cap is immutable — no update function exists

ETA: 24 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

    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