JSPM

stacks-voting

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q160347F
  • License MIT

Decentralized on-chain polls on Stacks blockchain - create and vote on proposals

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)

    Live on Mainnet npm downloads License: MIT TypeScript Next.js

    ๐Ÿš€ Try Demo ยท ๐Ÿ“œ View Contract ยท ๐Ÿ“– Docs


    โœจ 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 dev

    Open http://localhost:3000 to view.

    ๐Ÿ› ๏ธ Tech Stack

    • Smart Contract: Clarity on Stacks
    • Frontend: Next.js 14, React 18, TypeScript
    • Wallet: @stacks/connect v7.7.1
    • Transactions: @stacks/transactions v6.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:

    1. Fork the repo
    2. Create your feature branch (git checkout -b feature/amazing)
    3. Commit your changes (git commit -m 'Add amazing feature')
    4. Push to the branch (git push origin feature/amazing)
    5. Open a Pull Request

    ๐Ÿ“„ License

    MIT License - see LICENSE for details.


    Built for Stacks Builder Rewards ๐Ÿ—๏ธ

    โญ Star this repo if you find it useful!