From 50e1fb35257c09e903b42b272afd92c9ffebc3ee Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 28 Feb 2025 16:17:28 +0100 Subject: [PATCH] Update contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol --- .../extensions/GovernorVotesSuperQuorumFraction.sol | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol b/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol index 1467a3b566f..f2070adc626 100644 --- a/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol +++ b/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol @@ -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); }