fix
This commit is contained in:
@ -142,7 +142,9 @@ invariant quorumRatioLessThanOne(uint256 blockNumber)
|
|||||||
quorumNumerator(blockNumber) <= quorumDenominator()
|
quorumNumerator(blockNumber) <= quorumDenominator()
|
||||||
filtered { f -> !skip(f) }
|
filtered { f -> !skip(f) }
|
||||||
{
|
{
|
||||||
require quorumNumeratorLength() < max_uint256;
|
preserved {
|
||||||
|
require quorumNumeratorLength() < max_uint256;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -23,12 +23,13 @@ use invariant votesImplySnapshotPassed
|
|||||||
rule deadlineChangeToPreventLateQuorum(uint256 pId, env e, method f, calldataarg args)
|
rule deadlineChangeToPreventLateQuorum(uint256 pId, env e, method f, calldataarg args)
|
||||||
filtered { f -> !skip(f) }
|
filtered { f -> !skip(f) }
|
||||||
{
|
{
|
||||||
|
require clockSanity(e);
|
||||||
requireInvariant proposalStateConsistency(pId);
|
requireInvariant proposalStateConsistency(pId);
|
||||||
requireInvariant votesImplySnapshotPassed(e, pId);
|
requireInvariant votesImplySnapshotPassed(e, pId);
|
||||||
|
|
||||||
// This is not (easily) provable as an invariant because the prover think `_totalSupplyCheckpoints`
|
// This is not (easily) provable as an invariant because the prover think `_totalSupplyCheckpoints`
|
||||||
// can arbitrarily change, which causes the quorum() to change. Not sure how to fix that.
|
// can arbitrarily change, which causes the quorum() to change. Not sure how to fix that.
|
||||||
require !quorumReached(pId) <=> getExtendedDeadline(pId) == 0;
|
require quorumReached(pId) <=> getExtendedDeadline(pId) > 0;
|
||||||
|
|
||||||
uint256 deadlineBefore = proposalDeadline(pId);
|
uint256 deadlineBefore = proposalDeadline(pId);
|
||||||
bool deadlineExtendedBefore = getExtendedDeadline(pId) > 0;
|
bool deadlineExtendedBefore = getExtendedDeadline(pId) > 0;
|
||||||
@ -52,7 +53,7 @@ rule deadlineChangeToPreventLateQuorum(uint256 pId, env e, method f, calldataarg
|
|||||||
) || (
|
) || (
|
||||||
!deadlineExtendedBefore &&
|
!deadlineExtendedBefore &&
|
||||||
deadlineExtendedAfter &&
|
deadlineExtendedAfter &&
|
||||||
!quorumReachedBefore && // Not sure how to prove that
|
!quorumReachedBefore &&
|
||||||
quorumReachedAfter &&
|
quorumReachedAfter &&
|
||||||
deadlineAfter == clock(e) + lateQuorumVoteExtension() &&
|
deadlineAfter == clock(e) + lateQuorumVoteExtension() &&
|
||||||
votingAll(f)
|
votingAll(f)
|
||||||
|
|||||||
@ -149,7 +149,7 @@ rule onlyVoteCanChangeQuorumReached(uint256 pId, env e, method f, calldataarg ar
|
|||||||
f(e, args);
|
f(e, args);
|
||||||
|
|
||||||
// Needed because the prover doesn't understand the checkpoint properties of the voting token.
|
// Needed because the prover doesn't understand the checkpoint properties of the voting token.
|
||||||
require clock(e) > snapshot => token_getPastTotalSupply(snapshot) == cache;
|
require clock(e) > snapshot => token_getPastTotalSupply(snapshot) == totalSupply;
|
||||||
|
|
||||||
assert quorumReached(pId) != quorumReachedBefore => (
|
assert quorumReached(pId) != quorumReachedBefore => (
|
||||||
!quorumReachedBefore &&
|
!quorumReachedBefore &&
|
||||||
|
|||||||
Reference in New Issue
Block a user