Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🗳️ Permissionless Voting DApp (Stellar Soroban)

A fully decentralized and permissionless voting smart contract built on the Stellar Soroban platform using Rust.

🚀 Overview

This project implements a Simple Voting System where:

  • Anyone can create a poll
  • Anyone can vote
  • No admin or central authority exists
  • Each address can vote only once per poll

The contract is designed with true Web3 principles — open, transparent, and trustless.


✨ Features

  • 🔓 Permissionless Poll Creation Any user can create a poll with a question and options.

  • 🗳️ Open Voting System Any user can vote on any poll.

  • 🚫 No Admin Control No special privileges — fully decentralized.

  • One Vote Per Address Prevents duplicate voting using address-based tracking.

  • 📊 On-Chain Results Vote counts are stored and retrieved directly from the blockchain.


🛠️ Tech Stack

  • Blockchain: Stellar Soroban
  • Language: Rust
  • SDK: soroban-sdk

📁 Smart Contract Structure

Data Structures

  • Poll

    • id: Unique poll ID
    • question: Poll question
    • options: List of voting options
  • VoteCount

    • counts: Mapping of option → number of votes

⚙️ Contract Functions

1. create_poll

Creates a new poll.

Parameters:

  • poll_id (u32): Unique ID for the poll
  • question (Symbol): Poll question
  • options (Vec): List of options

2. vote

Allows a user to vote on a poll.

Parameters:

  • poll_id (u32)
  • voter (Address)
  • option (Symbol)

Rules:

  • A user can vote only once per poll
  • Requires authentication (require_auth)

3. get_poll

Fetches poll details.


4. get_results

Returns vote counts for each option.


🔐 Security & Design Principles

  • Permissionless by Default No admin-only functions or restricted access.

  • Sybil Resistance (Basic) One vote per blockchain address.

  • Transparent State All data is publicly accessible on-chain.


⚠️ Limitations

  • ❗ Poll IDs must be unique (handled off-chain)
  • ❗ No time limits for polls
  • ❗ No vote editing or deletion
  • ❗ Basic randomness (if extended for lotteries, etc.)

🧪 How to Use

  1. Deploy the contract on Stellar Soroban testnet
  2. Call create_poll with your question and options
  3. Users call vote with their choice
  4. Fetch results using get_results

🌐 Frontend Integration (Suggested)

  • Logo: VoteChain / OpenVote

  • Navbar:

    • Create Poll
    • View Polls
  • Hero Text:

    "Create and vote on polls — no permissions, no limits."


🔮 Future Improvements

  • Add poll expiration time
  • Store metadata using IPFS
  • Improve UI/UX with React
  • Wallet integration (Freighter)
  • Gas optimization

🤝 Contributing

Feel free to fork and improve this project. Contributions are welcome!


📜 License

MIT License


💡 Inspiration

Built with the vision of enabling free, open, and censorship-resistant voting systems using blockchain technology.

contract address : CDVVUMLYNC2LEGRATMIEJHA3U5GF3DSIKCU6MH6NMFEJA2R76SCVBWQ4

wallet address : GAYS4ZCG2GDJB7BS4MXSEHJC2ZZOQOBS5SQDV2GPTDJTY5JWIOTO6SRP

https://stellar.expert/explorer/testnet/contract/CDVVUMLYNC2LEGRATMIEJHA3U5GF3DSIKCU6MH6NMFEJA2R76SCVBWQ4

image

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages