Funding Proposal
The Vote contract provides the platform with a complete post-investment withdrawal mechanism, allowing community members to decide whether to approve funding proposals through a veto-style vote.
Functionality
The Vote contract
is a voting withdrawal system that allows cheque holders to create withdrawal proposals and decide whether to approve these proposals through votes from community members. The contract integrates an external logic contract (Logic) to obtain necessary data and execute specific logic.
The Vote contract inherits from ManagerUpgradeable, providing management functionalities and upgrade capabilities.
The variables:
Logic
:
Address of the external logic contract.totalProposal
:
Total number of proposals.proposals
:
Stores detailed information for each proposal.user2proposal
:
Records the voting status of users for each proposal.proposal2Time
:
Records the creation time of proposals.proposal2Claimed
:
Records the amount already claimed for each proposal.
The Functions
Events
NewProposal
: Triggered when a new proposal is created.NewVote
: Triggered when a user votes.
Initialization Function
initialize
: Initializes the contract, setting the logic contract address.
Management Functions
updateLogic
: Updates the logic contract address.
Proposal Management
createProposal
: Creates a withdrawal proposal; only cheque holders can create proposals.withdraw
: Withdraws funds based on the voting results.
User Voting
userVote
: Allows users to vote on proposals; only users who have participated in distributions have voting rights.
Query Functions
pendingToken
: Retrieves the amount of funds that can be claimed from a proposal.agrUserInfo
: Retrieves aggregated user information, including their voting participation status.
Logic
Cheque holders can create withdrawal proposals using the
createProposal
function. This function calls thegetPending
function of the logic contract to check available funds and temporarily transfers funds to the current contract.Users can vote on proposals using the
userVote
function. Their voting rights are determined by their participation amount in distributions.Project owners can withdraw funds based on the voting results using the
withdraw
function.
Interface
Last updated