Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stacks-voting) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ณ๏ธ Stacks Voting
Decentralized on-chain polls and governance on Stacks (Bitcoin L2)
โจ Features
| Feature | Description |
|---|---|
| ๐ณ๏ธ Create Polls | Set up polls with up to 6 options and custom duration |
| ๐ Sybil Resistant | One wallet = one vote, enforced on-chain |
| โก Real-time Results | Live vote counting directly from blockchain |
| โฐ Time-based Expiry | Polls automatically close after set duration |
| ๐ Fully Decentralized | All votes stored permanently on Stacks |
| ๐ผ Governance Ready | Use for DAOs, communities, or project decisions |
๐ Quick Start
# Clone the repo
git clone https://github.com/giwaov/stacks-voting.git
cd stacks-voting
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:3000 to view.
๐ ๏ธ Tech Stack
- Smart Contract: Clarity on Stacks
- Frontend: Next.js 14, React 18, TypeScript
- Wallet:
@stacks/connectv7.7.1 - Transactions:
@stacks/transactionsv6.13.0 - Styling: Tailwind CSS
๐ Smart Contracts (Mainnet)
| Contract | Address | Explorer |
|---|---|---|
| voting-v2 | SP3E0DQAHTXJHH5YT9TZCSBW013YXZB25QFDVXXWY.voting-v2 |
View โ |
| poll-analytics | SP3E0DQAHTXJHH5YT9TZCSBW013YXZB25QFDVXXWY.poll-analytics |
View โ |
| voter-reputation | SP3E0DQAHTXJHH5YT9TZCSBW013YXZB25QFDVXXWY.voter-reputation |
View โ |
๐ Stats: 3,900+ votes cast | 88+ unique voters | Live on mainnet
๐ Contract Functions
;; Create a new poll
(create-poll (title (string-utf8 100)) (description (string-utf8 500)) (options (list 6 (string-utf8 50))) (duration uint))
;; Cast your vote
(vote (poll-id uint) (option-index uint))
;; Read functions
(get-poll (id uint))
(get-vote-count (poll-id uint) (option-index uint))
(has-voted (poll-id uint) (voter principal))๐ค Contributing
Contributions welcome! Please:
- Fork the repo
- Create your feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
๐ License
MIT License - see LICENSE for details.
Built for Stacks Builder Rewards ๐๏ธ
โญ Star this repo if you find it useful!