A smart contract for binary voting on the Celo blockchain. This contract allows users to create proposals and vote on them using a simple yes/no (agree/disagree) mechanism.
⨠- Features
š - Create new proposals with descriptions
ā
- Vote on existing proposals (Agree/Disagree)
š - View proposal details including vote counts
š - Prevent double voting
š¢ - Event emission for proposal creation and voting
The Binary Voting project was built using several key technologies and follows a robust development process:
Written in Solidity (v0.8.0)
- Uses OpenZeppelin's contracts for security and best practices
Key components:
- Proposal struct to store proposal data
- mapping for efficient proposal storage and lookup
- mapping for tracking votes to prevent double-voting
- Events for tracking proposal creation and voting
Development Tools:
- Truffle for smart contract development and testing
- Ganache for local blockchain testing
- Web3.js for contract interaction
- Mocha and Chai for testing
- Testing Infrastructure:
- Comprehensive test suite covering:
- Proposal creation
- Voting functionality
- Double-voting prevention
- Event emission
- Tests run on both local blockchain and testnet
Deployment Process:
- Deployed to Celo mainnet using Truffle
- Contract verification through Celo Explorer
- Scripts for deployment and verification