Skip to main content

Alternative Approaches: Per-Investor vs Receipt-Based

Token distribution can be implemented through different approaches, each with distinct characteristics:

Per-Investor Tracking:
  • Individual claimable amounts calculated and stored onchain
  • Complex state management for participants
  • Gas costs increase linearly with participant count
Receipt-Based System:
  • Exchange rate calculations replace individual tracking
  • Constant gas costs regardless of participant count
  • Efficient scaling to thousands of participants

Distribution approaches differ in computational complexity and gas efficiency.

Scalability Comparison

Per-Investor Approach:
  • O(n) complexity: increasing with participant count
  • Individual state storage requirements
  • Increasing gas costs for larger participant groups
Receipt-Based Approach:
  • O(1) complexity: constant regardless of participants
  • Single exchange rate calculation
  • Consistent gas costs for any group size

Gas Efficiency Comparison

Distribution Initialization Costs:
Participant CountTraditional ApproachReceipt-Based Approach
100 investors~2,100,000 gas~50,000 gas
1,000 investors~21,000,000 gas~50,000 gas
10,000 investorsGas limit exceeded~50,000 gas

The receipt-based system maintains constant gas costs while per-investor accounting becomes prohibitively expensive and impossible at scale.