Browse Source

filter functions that should revert

Hadrien Croubois 2 years ago
parent
commit
397f4cdfe2
1 changed files with 10 additions and 6 deletions
  1. 10 6
      certora/specs/GovernorBaseRules.spec

+ 10 - 6
certora/specs/GovernorBaseRules.spec

@@ -108,9 +108,11 @@ rule noExecuteBeforeDeadline(uint256 pId, env e, method f, calldataarg args) {
 โ”‚ attribute to the execute() function, showing that only execute() can change it, and that it will always change it.  โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
 */
-rule allFunctionsRevertIfExecuted(uint256 pId, env e, method f, calldataarg args)
-    filtered { f -> !skip(f) }
-{
+rule allFunctionsRevertIfExecuted(uint256 pId, env e, method f, calldataarg args) filtered { f ->
+    !skip(f) &&
+    f.selector != updateQuorumNumerator(uint256).selector &&
+    f.selector != updateTimelock(address).selector
+} {
     require isExecuted(pId);
     requireInvariant noBothExecutedAndCanceled(pId);
     requireInvariant executedImplyCreated(pId);
@@ -129,9 +131,11 @@ rule allFunctionsRevertIfExecuted(uint256 pId, env e, method f, calldataarg args
 โ”‚ attribute to the execute() function, showing that only execute() can change it, and that it will always change it.  โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
 */
-rule allFunctionsRevertIfCanceled(uint256 pId, env e, method f, calldataarg args)
-    filtered { f -> !skip(f) }
-{
+rule allFunctionsRevertIfCanceled(uint256 pId, env e, method f, calldataarg args) filtered { f ->
+    !skip(f) &&
+    f.selector != updateQuorumNumerator(uint256).selector &&
+    f.selector != updateTimelock(address).selector
+} {
     require isCanceled(pId);
     requireInvariant noBothExecutedAndCanceled(pId);
     requireInvariant canceledImplyCreated(pId);