Soroban smart contracts for VoteChain — decentralized on-chain governance and voting on the Stellar blockchain.
VoteChain enables DAOs, protocols, and communities to create proposals, cast token-weighted votes, enforce quorum, and execute decisions — all transparently on-chain with an immutable audit trail.
- Proposals — create governance proposals with title, description, quorum, and voting duration
- Token-weighted voting — vote weight equals the voter's governance token balance
- Yes / No / Abstain — three-way vote with quorum and majority enforcement
- Double-vote prevention — each address can vote exactly once per proposal
- Lifecycle management — Active → Passed/Rejected → Executed, or Cancelled by admin
- On-chain events — every action emits a verifiable event for off-chain indexers
.
├── contracts
│ ├── governance # Proposal creation, voting, finalisation, execution
│ │ ├── src
│ │ │ ├── lib.rs
│ │ │ ├── storage.rs
│ │ │ ├── events.rs
│ │ │ ├── types.rs
│ │ │ └── test.rs
│ │ └── Cargo.toml
│ └── token # Governance token contract
│ ├── src
│ │ ├── lib.rs
│ │ ├── storage.rs
│ │ ├── types.rs
│ │ └── test.rs
│ └── Cargo.toml
├── Cargo.toml
├── Makefile
├── CONTRIBUTING.md
├── SECURITY.md
└── README.md
git clone https://github.com/Vera3289/votechain-contracts.git
cd votechain-contracts
rustup target add wasm32-unknown-unknown
make test
make build| Function | Caller | Description |
|---|---|---|
initialize(admin, voting_token) |
Admin | Set admin and governance token |
create_proposal(proposer, title, description, quorum, duration) |
Anyone | Create a new proposal |
cast_vote(voter, proposal_id, vote) |
Token holder | Cast Yes/No/Abstain vote |
finalise(proposal_id) |
Anyone | Finalise after voting period ends |
execute(admin, proposal_id) |
Admin | Mark a passed proposal as executed |
cancel(admin, proposal_id) |
Admin | Cancel an active proposal |
get_proposal(proposal_id) |
Anyone | Read proposal state |
has_voted(proposal_id, voter) |
Anyone | Check if address has voted |
proposal_count() |
Anyone | Total proposals created |
Active → Passed → Executed
→ Rejected
→ Cancelled
total_votes >= quorum AND votes_yes > votes_no
| Layer | Technology |
|---|---|
| Blockchain | Stellar (Soroban) |
| Language | Rust |
| SDK | Soroban SDK v22.0.0 |
| CI/CD | GitHub Actions |
See CONTRIBUTING.md.
See SECURITY.md.
Built with ❤️ on Stellar