Skip to content

feat: add event fee treasury variant#249

Merged
Akshola00 merged 5 commits intoWeb3Novalabs:mainfrom
JTKaduma:feature/add-event-fee-treasuary-variant
Mar 27, 2026
Merged

feat: add event fee treasury variant#249
Akshola00 merged 5 commits intoWeb3Novalabs:mainfrom
JTKaduma:feature/add-event-fee-treasuary-variant

Conversation

@JTKaduma
Copy link
Copy Markdown
Contributor

PR Description

Summary

This PR adds global event-fee treasury tracking for ticket purchases while preserving the existing per-pool fee split.

When a ticket is bought, the contract now continues to:

  • credit the event creator's pool share
  • credit the pool-specific platform fee bucket

and also:

  • accumulate the fee portion into EventFeeTreasury for centralized event-fee withdrawals/reporting

What Changed

  • Added StorageKey::EventFeeTreasury usage in buy_ticket to track aggregate event fees across ticket purchases.
  • Simplified TicketType default handling by deriving Default and marking Standard as the default variant.
  • Updated pool_created event plumbing to pass a single details tuple payload instead of multiple discrete parameters.
  • Scoped second_crowdfunding test-only interfaces behind #[cfg(test)] so they do not leak into non-test builds.
  • Added/expanded ticket-purchase tests to verify:
    • zero-fee purchases fully credit the event pool
    • per-pool fee buckets accumulate correctly
    • the global EventFeeTreasury is updated correctly across purchases

Why

This gives the contract a dedicated aggregate treasury for event fees, which makes fee accounting and withdrawals more straightforward without removing the existing per-pool revenue tracking.

Testing

  • Ran cargo test -q
  • Result: 230 passed; 0 failed

Closes #182

@Akshola00
Copy link
Copy Markdown
Contributor

@JTKaduma ci is failing

@Akshola00 Akshola00 merged commit 5a86461 into Web3Novalabs:main Mar 27, 2026
1 check passed
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.

Add StorageKey::EventFeeTreasury

2 participants