Add Community Voting System #6
Open
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.
Summary
This PR adds a complete Community Voting System that allows players to propose and vote on game improvements.
What's New
voting.clar) - Proposal creation, voting, and management/votingpage with proposal creation and voting interfaceKey Features
Technical Implementation
Smart Contract (
contracts/voting.clar)create-proposal,vote,close-proposalget-proposal,has-voted,get-proposal-countTests (
tests/voting.test.ts)Frontend
New Pages:
/voting- Main voting interfaceNew Components:
CreateProposal- Proposal creation formProposalsList- Displays proposals with voting UIUpdated Files:
frontend/lib/contract.ts- Added voting contract functionsfrontend/hooks/use-stacks.ts- Added voting transaction handlersfrontend/components/navbar.tsx- Added "Voting" linkDeployment
STA43VC8660WWNRHHWSXGK2VR4BVHGWN0Z63FXGD.voting0xf22faa4b4e8cb35e6aadf435c4ae39df2b1c0371f955942c020816657120fd8bHow to Test
Run Tests