-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(examples): Voting Realm: A Bitmap and Nonce-based Approach #2225
Closed
+618
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
…into add-package-nonces
github-actions
bot
added
the
🧾 package/realm
Tag used for new Realms or Packages.
label
May 28, 2024
@moul Here's a simple demo (still under development). I am using newly added packages. Please let me know if anything is unclear |
linhpn99
changed the title
Voting Realm: A Bitmap and Nonce-based Approach
feat(examples): Voting Realm: A Bitmap and Nonce-based Approach
May 28, 2024
7 tasks
moul
reviewed
Jun 29, 2024
title string // Title is the name or description of the proposal | ||
votes uint64 // Votes is the total number of votes the proposal has received | ||
voters *bitmap.Bitmap // Voters is a bitmap tracking whether users have voted | ||
userVoteCount *nonce.Manager // UserVoteCount maps user addresses to the number of votes they have cast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use an avl.Tree // std.Address -> *int
without needing to update the tree each time you increment the pointed integer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Simple UseCase Description :
1. Initialize the Contract :
2. Create a Proposal
3. Register as a Voter
4. Cast a Vote
5. Get Vote Count
From issue : #2119
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description