fix attempt
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
--- governance/extensions/GovernorPreventLateQuorum.sol 2023-03-07 10:48:47.733488857 +0100
|
--- governance/extensions/GovernorPreventLateQuorum.sol 2023-03-15 17:13:06.879632860 +0100
|
||||||
+++ governance/extensions/GovernorPreventLateQuorum.sol 2023-03-15 14:14:59.121060484 +0100
|
+++ governance/extensions/GovernorPreventLateQuorum.sol 2023-03-15 14:14:59.121060484 +0100
|
||||||
@@ -84,6 +84,11 @@
|
@@ -84,6 +84,11 @@
|
||||||
return _voteExtension;
|
return _voteExtension;
|
||||||
|
|||||||
@ -141,6 +141,9 @@ rule noExecuteBeforeDeadline(uint256 pId, env e, method f, calldataarg args)
|
|||||||
invariant quorumRatioLessThanOne(uint256 blockNumber)
|
invariant quorumRatioLessThanOne(uint256 blockNumber)
|
||||||
quorumNumerator(blockNumber) <= quorumDenominator()
|
quorumNumerator(blockNumber) <= quorumDenominator()
|
||||||
filtered { f -> !skip(f) }
|
filtered { f -> !skip(f) }
|
||||||
|
{
|
||||||
|
require quorumNumeratorLength() < max_uint256;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
|
|||||||
@ -41,9 +41,9 @@ invariant proposalStateConsistency(uint256 pId)
|
|||||||
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
*/
|
*/
|
||||||
invariant votesImplySnapshotPassed(env e, uint256 pId)
|
invariant votesImplySnapshotPassed(env e, uint256 pId)
|
||||||
getAgainstVotes(pId) == 0 => proposalSnapshot(pId) < clock(e) &&
|
getAgainstVotes(pId) > 0 => proposalSnapshot(pId) <= clock(e) &&
|
||||||
getForVotes(pId) == 0 => proposalSnapshot(pId) < clock(e) &&
|
getForVotes(pId) > 0 => proposalSnapshot(pId) <= clock(e) &&
|
||||||
getAbstainVotes(pId) == 0 => proposalSnapshot(pId) < clock(e)
|
getAbstainVotes(pId) > 0 => proposalSnapshot(pId) <= clock(e)
|
||||||
{
|
{
|
||||||
preserved {
|
preserved {
|
||||||
require clockSanity(e);
|
require clockSanity(e);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import "Governor.helpers.spec"
|
|||||||
import "GovernorInvariants.spec"
|
import "GovernorInvariants.spec"
|
||||||
|
|
||||||
use invariant proposalStateConsistency
|
use invariant proposalStateConsistency
|
||||||
|
use invariant votesImplySnapshotPassed
|
||||||
|
|
||||||
/*
|
/*
|
||||||
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
@ -138,6 +139,7 @@ rule onlyVoteCanChangeQuorumReached(uint256 pId, env e, method f, calldataarg ar
|
|||||||
filtered { f -> !skip(f) }
|
filtered { f -> !skip(f) }
|
||||||
{
|
{
|
||||||
require clockSanity(e);
|
require clockSanity(e);
|
||||||
|
requireInvariant votesImplySnapshotPassed(e, pId);
|
||||||
|
|
||||||
bool quorumReachedBefore = quorumReached(pId);
|
bool quorumReachedBefore = quorumReached(pId);
|
||||||
|
|
||||||
|
|||||||
@ -50,4 +50,5 @@ methods {
|
|||||||
getAgainstVotes(uint256) returns uint256 envfree
|
getAgainstVotes(uint256) returns uint256 envfree
|
||||||
getForVotes(uint256) returns uint256 envfree
|
getForVotes(uint256) returns uint256 envfree
|
||||||
getAbstainVotes(uint256) returns uint256 envfree
|
getAbstainVotes(uint256) returns uint256 envfree
|
||||||
|
quorumNumeratorLength() returns uint256 envfree
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user