|
@@ -9,10 +9,23 @@ import "../munged/governance/extensions/GovernorVotesQuorumFraction.sol";
|
|
|
import "../munged/governance/extensions/GovernorTimelockControl.sol";
|
|
|
import "../munged/token/ERC20/extensions/ERC20Votes.sol";
|
|
|
|
|
|
-contract GovernorPreventLateQuorumHarness is Governor, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl, GovernorPreventLateQuorum {
|
|
|
+contract GovernorPreventLateQuorumHarness is
|
|
|
+ Governor,
|
|
|
+ GovernorCountingSimple,
|
|
|
+ GovernorVotes,
|
|
|
+ GovernorVotesQuorumFraction,
|
|
|
+ GovernorTimelockControl,
|
|
|
+ GovernorPreventLateQuorum
|
|
|
+{
|
|
|
using SafeCast for uint256;
|
|
|
using Timers for Timers.BlockNumber;
|
|
|
- constructor(IVotes _token, TimelockController _timelock, uint64 initialVoteExtension, uint256 quorumNumeratorValue)
|
|
|
+
|
|
|
+ constructor(
|
|
|
+ IVotes _token,
|
|
|
+ TimelockController _timelock,
|
|
|
+ uint64 initialVoteExtension,
|
|
|
+ uint256 quorumNumeratorValue
|
|
|
+ )
|
|
|
Governor("Harness")
|
|
|
GovernorVotes(_token)
|
|
|
GovernorVotesQuorumFraction(quorumNumeratorValue)
|
|
@@ -26,65 +39,71 @@ contract GovernorPreventLateQuorumHarness is Governor, GovernorCountingSimple, G
|
|
|
uint256 public latestCastVoteCall;
|
|
|
|
|
|
// Harness from GovernorPreventLateQuorum //
|
|
|
-
|
|
|
- function getVoteExtension() public view returns(uint64) {
|
|
|
+
|
|
|
+ function getVoteExtension() public view returns (uint64) {
|
|
|
return _voteExtension;
|
|
|
}
|
|
|
|
|
|
- function getExtendedDeadlineIsUnset(uint256 proposalId) public view returns(bool) {
|
|
|
+ function getExtendedDeadlineIsUnset(uint256 proposalId) public view returns (bool) {
|
|
|
return _extendedDeadlines[proposalId].isUnset();
|
|
|
}
|
|
|
|
|
|
- function getExtendedDeadlineIsStarted(uint256 proposalId) public view returns(bool) {
|
|
|
+ function getExtendedDeadlineIsStarted(uint256 proposalId) public view returns (bool) {
|
|
|
return _extendedDeadlines[proposalId].isStarted();
|
|
|
}
|
|
|
|
|
|
- function getExtendedDeadline(uint256 proposalId) public view returns(uint64) {
|
|
|
+ function getExtendedDeadline(uint256 proposalId) public view returns (uint64) {
|
|
|
return _extendedDeadlines[proposalId].getDeadline();
|
|
|
}
|
|
|
|
|
|
- // Harness from GovernorCountingSimple //
|
|
|
+ // Harness from GovernorCountingSimple //
|
|
|
|
|
|
- function getAgainstVotes(uint256 proposalId) public view returns(uint256) {
|
|
|
+ function getAgainstVotes(uint256 proposalId) public view returns (uint256) {
|
|
|
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
|
|
return proposalvote.againstVotes;
|
|
|
}
|
|
|
|
|
|
- function getAbstainVotes(uint256 proposalId) public view returns(uint256) {
|
|
|
+ function getAbstainVotes(uint256 proposalId) public view returns (uint256) {
|
|
|
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
|
|
return proposalvote.abstainVotes;
|
|
|
}
|
|
|
|
|
|
- function getForVotes(uint256 proposalId) public view returns(uint256) {
|
|
|
+ function getForVotes(uint256 proposalId) public view returns (uint256) {
|
|
|
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
|
|
return proposalvote.forVotes;
|
|
|
}
|
|
|
-
|
|
|
- function quorumReached(uint256 proposalId) public view returns(bool) {
|
|
|
+
|
|
|
+ function quorumReached(uint256 proposalId) public view returns (bool) {
|
|
|
return _quorumReached(proposalId);
|
|
|
}
|
|
|
|
|
|
- function voteSucceeded(uint256 proposalId) public view returns(bool) {
|
|
|
+ function voteSucceeded(uint256 proposalId) public view returns (bool) {
|
|
|
return _voteSucceeded(proposalId);
|
|
|
}
|
|
|
|
|
|
// Harness from Governor //
|
|
|
|
|
|
- function getExecutor() public view returns (address){
|
|
|
+ function getExecutor() public view returns (address) {
|
|
|
return _executor();
|
|
|
}
|
|
|
|
|
|
function isExecuted(uint256 proposalId) public view returns (bool) {
|
|
|
return _proposals[proposalId].executed;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function isCanceled(uint256 proposalId) public view returns (bool) {
|
|
|
return _proposals[proposalId].canceled;
|
|
|
}
|
|
|
|
|
|
// The following functions are overrides required by Solidity added by Certora. //
|
|
|
|
|
|
- function proposalDeadline(uint256 proposalId) public view virtual override(Governor, GovernorPreventLateQuorum, IGovernor) returns (uint256) {
|
|
|
+ function proposalDeadline(uint256 proposalId)
|
|
|
+ public
|
|
|
+ view
|
|
|
+ virtual
|
|
|
+ override(Governor, GovernorPreventLateQuorum, IGovernor)
|
|
|
+ returns (uint256)
|
|
|
+ {
|
|
|
return super.proposalDeadline(proposalId);
|
|
|
}
|
|
|
|
|
@@ -100,7 +119,7 @@ contract GovernorPreventLateQuorumHarness is Governor, GovernorCountingSimple, G
|
|
|
|
|
|
// added to run GovernorCountingSimple.spec
|
|
|
uint256 deltaWeight = super._castVote(proposalId, account, support, reason, params);
|
|
|
- ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
|
|
+ ghost_sum_vote_power_by_id[proposalId] += deltaWeight;
|
|
|
|
|
|
return deltaWeight;
|
|
|
}
|
|
@@ -132,44 +151,39 @@ contract GovernorPreventLateQuorumHarness is Governor, GovernorCountingSimple, G
|
|
|
return super.quorum(blockNumber);
|
|
|
}
|
|
|
|
|
|
- function state(uint256 proposalId)
|
|
|
- public
|
|
|
- view
|
|
|
- override(Governor, GovernorTimelockControl)
|
|
|
- returns (ProposalState)
|
|
|
- {
|
|
|
+ function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
|
|
|
return super.state(proposalId);
|
|
|
}
|
|
|
|
|
|
- function propose(address[] memory targets, uint256[] memory values, bytes[] memory calldatas, string memory description)
|
|
|
- public
|
|
|
- override(Governor, IGovernor)
|
|
|
- returns (uint256)
|
|
|
- {
|
|
|
+ function propose(
|
|
|
+ address[] memory targets,
|
|
|
+ uint256[] memory values,
|
|
|
+ bytes[] memory calldatas,
|
|
|
+ string memory description
|
|
|
+ ) public override(Governor, IGovernor) returns (uint256) {
|
|
|
return super.propose(targets, values, calldatas, description);
|
|
|
}
|
|
|
|
|
|
- function _execute(uint256 proposalId, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash)
|
|
|
- internal
|
|
|
- override(Governor, GovernorTimelockControl)
|
|
|
- {
|
|
|
+ function _execute(
|
|
|
+ uint256 proposalId,
|
|
|
+ address[] memory targets,
|
|
|
+ uint256[] memory values,
|
|
|
+ bytes[] memory calldatas,
|
|
|
+ bytes32 descriptionHash
|
|
|
+ ) internal override(Governor, GovernorTimelockControl) {
|
|
|
super._execute(proposalId, targets, values, calldatas, descriptionHash);
|
|
|
}
|
|
|
|
|
|
- function _cancel(address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash)
|
|
|
- internal
|
|
|
- override(Governor, GovernorTimelockControl)
|
|
|
- returns (uint256)
|
|
|
- {
|
|
|
+ function _cancel(
|
|
|
+ address[] memory targets,
|
|
|
+ uint256[] memory values,
|
|
|
+ bytes[] memory calldatas,
|
|
|
+ bytes32 descriptionHash
|
|
|
+ ) internal override(Governor, GovernorTimelockControl) returns (uint256) {
|
|
|
return super._cancel(targets, values, calldatas, descriptionHash);
|
|
|
}
|
|
|
|
|
|
- function _executor()
|
|
|
- internal
|
|
|
- view
|
|
|
- override(Governor, GovernorTimelockControl)
|
|
|
- returns (address)
|
|
|
- {
|
|
|
+ function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
|
|
|
return super._executor();
|
|
|
}
|
|
|
|
|
@@ -181,4 +195,4 @@ contract GovernorPreventLateQuorumHarness is Governor, GovernorCountingSimple, G
|
|
|
{
|
|
|
return super.supportsInterface(interfaceId);
|
|
|
}
|
|
|
-}
|
|
|
+}
|