This project is a decentralized voting platform leveraging the Solana blockchain to ensure secure and transparent voting processes. It allows for the initiation of various voting sessions that are accessible to all participants.
- Developers:
- Sébastien Gazeau: Frontend
- Maxime Auburtin : Unit tests
- Constance Beguier: Solana Program
- Deployed dApp Frontend: Link to Vercel Deployment
- Program Explorer Link: Solscan Explorer
- Tech Stack Used:
- Frontend: next 12.1.4, react 18.0.0
- Unit Tests: mocha 9.0.3, chai 4.3.4
- Program: anchor-cli 0.29.0, rustc 1.79.0
- Phantom Wallet
Upon the creation of a proposal, where the administrator defines the title, description, and the start and end of each period, a voting session is created. A voting session is divided into three non-overlapping periods:
- Choice Registration Period: The administrator can add choices to a proposal.
- Voter Registration Period: The administrator can register voters to participate in the proposal.
- Voting Period: Registered voters can cast their votes.
- Create Proposal: Administrator can create proposals with a title, description, and defined time periods for choice registration, voter registration, and voting.
- Add Choices: Administrator can add choices to an existing proposal during the choice registration period.
- Register Voters: Administrator can register a voter to participate in a proposal during the voter registration period.
- Cast Vote: Registered voters can cast their votes during the voting period.
To use the platform, follow these steps:
-
Create a Proposal
create_proposal
:- An administrator creates a proposal by specifying the title, description, and time periods for choice registration, voter registration, and voting.
-
Add Choices
add_choice_for_one_proposal
:- During the choice registration period, the administrator can add multiple choices to the proposal.
-
Register Voters
register_voter
:- During the voter registration period, administrator can register a voter to participate in the proposal.
-
Cast Votes
cast_vote
:- During the voting period, each voter can vote for its choice in a proposal
anchor build
Our smart contract has a unit test coverage above 80%
To launch tests please use the following command:
anchor test
or:
solana-test-validator anchor test --skip-local-validator
Our frontend has been made with React and web3.js
Here is how it looks like:
cd app/ yarn install && yarn build
yarn start