decentdao / decent-contracts

Your Safe, Superpowered
https://app.fractalframework.xyz
MIT License
3 stars 3 forks source link

Add `MeetsQuorum` to `LinearERC721Voting.sol` #75

Closed Da-Colon closed 1 month ago

Da-Colon commented 6 months ago

To ensure that quorum is calculated properly across platforms (Onchain or via the frontend). We should abstract the logic for calculating ERC721 current quorum from the isPassed function

    /** @inheritdoc BaseStrategy*/
    function isPassed(uint32 _proposalId) public view override returns (bool) {
        return (
            block.number > proposalVotes[_proposalId].votingEndBlock && // voting period has ended
            quorumThreshold <= proposalVotes[_proposalId].yesVotes + proposalVotes[_proposalId].abstainVotes && // yes + abstain votes meets the quorum
            meetsBasis(proposalVotes[_proposalId].yesVotes, proposalVotes[_proposalId].noVotes) // yes votes meets the basis
        );
    }

To be specific this section should be moved to its own meetsQuorum function.

quorumThreshold <= proposalVotes[_proposalId].yesVotes + proposalVotes[_proposalId].abstainVotes`
Da-Colon commented 6 months ago

@adamgall Implementing meetsQuorum from the linear strategy I had a thought. currently this function only takes in totalSupply, yes votes, abstain votes as arguments.

Does this affect any future changes by a DAO to change this via a proposal?

adamgall commented 1 month ago

Stale, closing