Skip to content

Add creator key airdrop so creators can gift keys to a list of wallets at their own cost #523

Description

@Chucks1093

Summary

Creators want to reward early community members, run giveaways, or bootstrap a new audience by gifting keys. An airdrop function lets the creator pay the bonding curve price themselves and send keys directly to a list of recipient wallets in a single transaction, without recipients needing to do anything.

Scope

  • Add airdrop_keys(creator_id, recipients: Vec<AirdropEntry>) -> AirdropSummary callable only by the creator
    • AirdropEntry { address: Address, amount: u32 }
    • For each recipient: mint amount keys at the current bonding curve price and credit their balance
    • The creator pays the total XLM cost for all keys across all recipients
    • Supply increases by the total airdropped amount, moving the curve normally
    • Creator fee is waived on airdrops (creator is paying themselves); protocol fee applies to the total
    • Maximum 50 recipients per airdrop call
    • Returns AirdropSummary { total_keys, total_cost, recipient_count }
  • Emits KeysAirdropped { creator_id, total_keys, total_cost, recipient_count, ledger } event
  • Per-wallet cap (if set) is enforced for each recipient — recipients already at the cap are skipped and reported in the summary

Acceptance Criteria

  • Each recipient balance increases by their airdropped amount
  • Total supply increases by the sum of all airdropped keys
  • Creator pays total bonding curve cost for all keys
  • Creator fee waived; protocol fee applied to total
  • More than 50 recipients reverts with a clear error
  • Recipients at their wallet cap are skipped, not reverted
  • KeysAirdropped event emitted with correct summary fields
  • Non-creator caller reverts with Unauthorized

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

    Fields

    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