Skip to content

Commit

Permalink
Update contracts/governance/extensions/GovernorVotesSuperQuorumFracti…
Browse files Browse the repository at this point in the history
…on.sol
  • Loading branch information
Amxx authored Feb 28, 2025
1 parent 8e9359c commit 50e1fb3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ abstract contract GovernorVotesSuperQuorumFraction is GovernorVotesQuorumFractio
* quorum numerator is bigger than the quorum numerator.
*/
function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual override {
uint256 superQuorumNumerator_ = superQuorumNumerator();
// Ignoring check when the superQuorum was never set (construction sets quorum before superQuorum)
if (newQuorumNumerator > superQuorumNumerator_ && _superQuorumNumeratorHistory.length() != 0) {
revert GovernorInvalidQuorumTooLarge(newQuorumNumerator, superQuorumNumerator_);
if (_superQuorumNumeratorHistory.length() > 0) {
uint256 superQuorumNumerator_ = superQuorumNumerator();
if (newQuorumNumerator > superQuorumNumerator_) {
revert GovernorInvalidQuorumTooLarge(newQuorumNumerator, superQuorumNumerator_);
}
}
super._updateQuorumNumerator(newQuorumNumerator);
}
Expand Down

0 comments on commit 50e1fb3

Please sign in to comment.