Skip to main content

Reward Distributor

Purpose​

Allocate and distribute rewards based on reported usage units per period.

Scope​

This contract executes reward distribution. It does not define scoring logic or payment vault balances.

Note​

RewardDistributor is retained for legacy testing. The current MVP reward flow uses EpochUsageRegistry and EpochRewardDistributor for multi-gateway reporting.

Actors and Roles​

  • Reporter role: submits usage units for providers and gateways.
  • FeeCollector: funds reward pools per period and token.
  • Recipients: providers and gateways claim after period finalization.

State and Storage Model (High-Level)​

  • Per-period unit totals for providers and gateways.
  • Per-period pools per token.
  • Claimed accounting per recipient, token, and period.

Core Flows (State Machine)​

  • reportUsage increments provider and gateway units.
  • notifyReward funds the pool and splits to treasury.
  • finalizePeriod closes a period for claims.
  • claimProvider / claimGateway pay out pro-rata.

Protocol Guarantees​

  • Rewards are distributed only from funded pools.
  • Recipients cannot claim more than their pro-rata share.

Security Invariants​

  • Only reporters can submit usage.
  • Only the fee collector can fund pools.

Threat Model​

  • Auth bypass on reporting or funding.
  • Double-claim attempts.
  • Malicious token behavior.

Economic Constraints​

  • Total distribution is bounded by funded pools and token balances.

Governance and Admin Controls​

Owner sets reporters, fee collector, treasury, and share splits.

Events (Optional)​

  • UsageReported, RewardNotified, ProviderClaimed, GatewayClaimed

Integration Notes​

  • Track allocation updates before initiating claims.
  • Treat allocation sources as authoritative inputs.

Disclaimers​

Rewards depend on actual fees and reported usage. Outcomes are variable and may be zero. No guarantees. Not investment advice.