/Vote-Dao

A decentralized autonomous organization (DAO) voting system. Users can propose, vote, and execute proposals with locked token requirements

Primary LanguageSolidity

Project Name: Decentralized Autonomous Organization (DAO) Contract Overview: The DAO contract empowers decentralized governance by facilitating proposal creation, voting, and execution within a decentralized organization. Users can submit proposals, cast votes, and determine outcomes through a transparent and democratic process. Below is a comprehensive overview of the contract's functionalities and features:

Features: Constructor: Initializes contract parameters including token address, minimum tokens required to vote, vote fee, and voting duration. State Variables: tokenAddress: Address of the ERC20 token used for voting. minTokensToVote: Minimum tokens required for voting participation. voteFee: Fee in tokens required for each vote. votingDuration: Duration of the voting period for proposals. Proposal Status: Enum representing the status of a proposal: Pending, Approved, or Rejected. Proposal Struct: Contains attributes such as description, budget, timeline, proposer's address, and voting-related information. Events: ProposalSubmitted: Triggered when a new proposal is submitted. Voted: Triggered when a user casts their vote on a proposal. ProposalExecuted: Triggered upon proposal execution, indicating its approval/rejection and the reason. MinTokensToVoteSet, VoteFeeSet, VotingDurationSet, TokenAddressUpdated: Events for updating contract parameters. Core Functions: submitProposal: Allows users to submit proposals. vote: Enables users to cast votes on proposals during the voting period. executeProposal: Allows the owner to execute proposals based on the voting outcome. Utility Functions: setMinTokensToVote, setVoteFee, setVotingDuration: Owner can update contract parameters. withdrawTokens: Owner can withdraw tokens from the contract. Various getter functions to retrieve proposal details. Additional Features: Prevents proposer from voting on their own proposal. Enforces voting within specified periods. Logs reasons for proposal approval/rejection. Requires minimum tokens and charges fees for voting participation.