Skip to content

feat: protocol fee distributor with automatic reward splitting - #120

Merged
elizabetheonoja-art merged 1 commit into
Utility-Protocol:mainfrom
JamesEjembi:feat/issue-62-fee-distributor
Jul 25, 2026
Merged

feat: protocol fee distributor with automatic reward splitting#120
elizabetheonoja-art merged 1 commit into
Utility-Protocol:mainfrom
JamesEjembi:feat/issue-62-fee-distributor

Conversation

@JamesEjembi

Copy link
Copy Markdown
Contributor

Implements a protocol-level fee collection and distribution contract with four integrated modules:

FeeCollector

  • — Accumulates fees from whitelisted collectors
  • Configurable collector set managed by admin governance
  • Prevents double-spend by tracking pending fees per period

FeeDistributor

  • — Admin seals a period with a Merkle root
  • — Claimants verify their allocation via Merkle proof
  • Period rotates automatically when is called

SplitConfig

  • Basis-point-based split ratios that must sum to 10,000
  • Updated via by admin
  • Validates no duplicate recipients, no zero bps, total == 10000

SweepHandler

  • Unclaimed fees auto-eligible for sweep after ~90 days (518,400 ledgers)
  • Admin-only sends unclaimed funds to treasury
  • Swept periods are marked and cannot be re-claimed

Tests

12 tests covering initialization, auth, deposit, period close, claim (error paths), sweep deadlines, split validation, and getters.

Closes #62

Implement FeeDistributor contract for collecting, distributing, and
sweeping protocol fees with Merkle proof verification.

Components:
- SplitConfig — Governance-controlled fee split ratios (basis points)
- FeeCollector — Configurable fee collectors with deposit authorization
- FeeDistributor — Period-based distribution with Merkle claim verification
- SweepHandler — Unclaimed fee sweep after 90-day deadline

Closes Utility-Protocol#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protocol Fee Distributor Contract with Automatic Reward Splitting

2 participants