At its core, the Lens Voting Plugin relies on several external dependencies, including IFollowNFT, SafeCastUpgradeable, IMembership, IMajorityVoting, MajorityVotingBase, and IDAO contracts. These dependencies provide the necessary foundations for seamless integration and optimal functionality.
The contract is created by inheriting the MajorityVotingBase contract and implements the
IMajortiyVoting from the AragonOSx contracts.
getVotingToken: This getter function allows users to retrieve the DAO's voting token, which is implemented as an interface for Lens Follow NFTs. By accessing this function, NFT holders can easily identify and interact with the relevant token associated with voting rights.
totalVotingPower: With this function, Lens Follow NFT holders can verify their delegate voting power within the DAO. By checking the block number at the time of calling, users gain insights into their influence and impact on governance decisions.
createProposal: The createProposal function empowers NFT holders to initiate new majority voting proposals within the DAO. By invoking this function, users can propose changes, improvements, or actions that will be subject to voting by the DAO's stakeholders.
isMember: The function returns a boolean value after checking if an address has voting power at the block number when it is called.
_vote: This internal function enables voting on proposals.
_canVote: Before casting a vote, it is essential to verify whether an address has the eligibility to vote. The _canVote function fulfills this role by performing checks and returning a boolean value indicating whether an address can exercise its voting rights.
Technologies we used
- OpenZeppelin Contracts
- Aragon OSx
- Lens Contract