Skip to content

feat: prevent over-withdrawal of platform fees (#208)#277

Merged
Akshola00 merged 3 commits intoWeb3Novalabs:mainfrom
DavisVT:feat/prevent-over-withdrawal-platform-fees
Mar 31, 2026
Merged

feat: prevent over-withdrawal of platform fees (#208)#277
Akshola00 merged 3 commits intoWeb3Novalabs:mainfrom
DavisVT:feat/prevent-over-withdrawal-platform-fees

Conversation

@DavisVT
Copy link
Copy Markdown
Contributor

@DavisVT DavisVT commented Mar 30, 2026

  • Guard withdraw_platform_fees against withdrawing more than tracked PlatformFees balance (InsufficientFees)
  • Ensure admin cannot drain event pool funds via platform fee withdrawal
  • Add tests: over-withdrawal blocked, exact balance succeeds
  • Fix pre-existing merge conflicts in crowdfunding.rs and interfaces/crowdfunding.rs
  • Fix duplicate EventMetrics struct and StorageKey variants
  • Add missing StorageKey variants: AllEventsCount, AllEvents, TicketCount
  • Fix buy_ticket to record UserTicket and update PoolEventMetrics.total_collected
  • Fix pool_created event to call record_event for accurate event tracking
  • Fix test compilation issues across buy_ticket_test, crowdfunding_test, set_platform_fee_bps_test, upgrade_contract_test

closes #208

DavisVT added 2 commits March 30, 2026 11:17
- Guard withdraw_platform_fees against withdrawing more than tracked PlatformFees balance (InsufficientFees)
- Ensure admin cannot drain event pool funds via platform fee withdrawal
- Add tests: over-withdrawal blocked, exact balance succeeds
- Fix pre-existing merge conflicts in crowdfunding.rs and interfaces/crowdfunding.rs
- Fix duplicate EventMetrics struct and StorageKey variants
- Add missing StorageKey variants: AllEventsCount, AllEvents, TicketCount
- Fix buy_ticket to record UserTicket and update PoolEventMetrics.total_collected
- Fix pool_created event to call record_event for accurate event tracking
- Fix test compilation issues across buy_ticket_test, crowdfunding_test, set_platform_fee_bps_test, upgrade_contract_test
@DavisVT
Copy link
Copy Markdown
Contributor Author

DavisVT commented Mar 30, 2026

i've tried everything to fix this but it isn't working
can you just merge

@Akshola00
Copy link
Copy Markdown
Contributor

I can't merge until conflicts are solved

@DavisVT
Copy link
Copy Markdown
Contributor Author

DavisVT commented Mar 31, 2026

@Akshola00 Resolved conflict

@Akshola00 Akshola00 merged commit 6b0476b into Web3Novalabs:main Mar 31, 2026
1 check failed
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.

Prevent withdrawing more fees than exist

2 participants