Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep track of historical quorum values #3561

Merged
merged 11 commits into from
Jul 27, 2022
Prev Previous commit
Next Next commit
fix creation of Checkpoint struct
  • Loading branch information
frangio committed Jul 18, 2022
commit 19da84a7f0ff198546cfecdb27bb4acde3651d53
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.0;

import "./GovernorVotes.sol";
import "../../utils/Checkpoints.sol";
import "../../utils/math/SafeCast.sol";

/**
* @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a
Expand Down Expand Up @@ -97,7 +98,7 @@ abstract contract GovernorVotesQuorumFraction is GovernorVotes {
// make sure we keep track of the old numerator (applicable to upgrade only)
if (_quorumNumeratorHistory._checkpoints.length == 0) {
_quorumNumeratorHistory._checkpoints.push(
Checkpoints({ _blockNumber: 0, _value: oldQuorumNumerator })
Checkpoints.Checkpoint({_blockNumber: 0, _value: SafeCast.toUint224(oldQuorumNumerator)})
);
}

Expand Down