// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol"; abstract contract ForAgainstWeightedQuorum is GovernorCountingSimple { function COUNTING_MODE() public pure override(GovernorCountingSimple) returns (string memory) { return "quorum=for-against&succeed=for>against"; } function _quorumReached( uint256 proposalId ) internal view virtual override(GovernorCountingSimple) returns (bool) { (uint256 againstVotes, uint256 forVotes, ) = proposalVotes(proposalId); if (forVotes > againstVotes) { return (forVotes - againstVotes) >= quorum(proposalSnapshot(proposalId)); } return false; } function _voteSucceeded( uint256 proposalId ) internal view virtual override(GovernorCountingSimple) returns (bool) { (uint256 againstVotes, uint256 forVotes, ) = proposalVotes(proposalId); return forVotes > againstVotes && _quorumReached(proposalId); } }