Browse Source

added invariants if executed or canceled always revert

Michael M 3 years ago
parent
commit
5ea1cc7a8a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      certora/specs/GovernorBase.spec

+ 12 - 0
certora/specs/GovernorBase.spec

@@ -40,6 +40,18 @@ invariant noExecuteOrCancelBeforeStarting(env e, uint256 pId) e.block.number < p
  */
 invariant executionOnlyIfQuoromReachedAndVoteSucceeded(uint256 pId) isExecuted(pId) => _quorumReached(pId) && _voteSucceeded(pId)
 
+/*
+ * No functions should be allowed to run after a job is deemed as canceled
+ */
+invariant cannotSetIfCanceled(uint256 pId)
+    isCanceled(pId) => lastReverted == true
+
+/*
+ * No functions should be allowed to run after a job is deemed as executed
+ */
+invariant cannotSetIfExecuted(uint256 pId)
+    isExecuted(pId) => lastReverted == true
+
 
 
 //////////////////////////////////////////////////////////////////////////////