Skip to content

feat: store dao member count of each epoch#778

Closed
kyubinokitsune-ace wants to merge 2 commits intoqubic:mainfrom
QDoge-Team:main
Closed

feat: store dao member count of each epoch#778
kyubinokitsune-ace wants to merge 2 commits intoqubic:mainfrom
QDoge-Team:main

Conversation

@kyubinokitsune-ace
Copy link
Contributor

No description provided.

@kyubinokitsune-ace
Copy link
Contributor Author

I've created a comprehensive description of the smart contract implementation. Here's a summary:

Smart Contract Changes Summary

What was added:

  • New field numberOfDaoMembers to QuRaffleInfo struct (4 bytes per epoch)
  • Store state.numberOfRegisters during END_EPOCH
  • Return numberOfDaoMembers in getEndedQuRaffle function

Why it's needed:

  • DAO members (registered users) receive 5% dividends from ALL raffles
  • DAO member count changes over time (users register/logout)
  • QRaffle need historical DAO member counts to calculate per-member dividends
  • Previously required manual tracking or transaction replay

Key distinction:

  • numberOfMembers = raffle participants (who entered that specific raffle)
  • numberOfDaoMembers = DAO registered users (who receive dividends from all raffles)

Impact:

  • Memory: ~256 KB additional storage (4 bytes × 65536 epochs)
  • Performance: No impact, just storing one additional uint32 per epoch
  • Backward compatible: Legacy epochs will have numberOfDaoMembers = 0

The implementation is minimal, efficient, and solves the qraffle's problem of needing to manually track DAO member counts for historical dividend calculations.

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.

1 participant