MoreRulesAndFixesOfExistedRules

This commit is contained in:
Aleksander Kryukov
2021-11-16 19:53:07 +02:00
parent daad23b3a7
commit eb27bdd282
5 changed files with 123 additions and 41 deletions

View File

@ -21,6 +21,7 @@ methods {
// function summarization
hashProposal(address[], uint256[], bytes[], bytes32) => CONSTANT
proposalThreshold() returns uint256 envfree
}
//////////////////////////////////////////////////////////////////////////////
@ -292,3 +293,19 @@ rule executedOnlyAfterExecuteFunc(address[] targets, uint256[] values, bytes[] c
bool executedAfter = isExecuted(pId);
assert(executedAfter != executedBefore, "executed property did not change");
}
/*
* User should not be able to affect proposal threshold
*/
rule unaffectedThreshhold(method f){
uint256 thresholdBefore = proposalThreshold();
env e;
calldataarg args;
f(e, args);
uint256 thresholdAfter = proposalThreshold();
assert thresholdBefore == thresholdAfter, "threshold was changed";
}