Browse Source

cleaning in process

Aleksander Kryukov 3 years ago
parent
commit
73080c79d0

+ 1 - 2
certora/harnesses/WizardFirstPriority.sol

@@ -54,7 +54,6 @@ contract WizardFirstPriority is Governor, GovernorProposalThreshold, GovernorCou
         return deltaWeight;        
     }
     
-
     function snapshot(uint256 proposalId) public view returns (uint64) {
         return _proposals[proposalId].voteStart._deadline;
     }
@@ -64,7 +63,7 @@ contract WizardFirstPriority is Governor, GovernorProposalThreshold, GovernorCou
         return _executor();
     }
 
-    // original code
+    // original code, harnessed
 
     function votingDelay() public view override returns (uint256) {     // HARNESS: pure -> view
         return _votingDelay;                                            // HARNESS: parametric

+ 14 - 21
certora/harnesses/WizardFirstTry.sol

@@ -21,7 +21,7 @@ contract WizardFirstTry is Governor, GovernorCountingSimple, GovernorVotes, Gove
         GovernorTimelockCompound(_timelock)
     {}
 
-    
+    //HARNESS
 
     function isExecuted(uint256 proposalId) public view returns (bool) {
         return _proposals[proposalId].executed;
@@ -31,17 +31,17 @@ contract WizardFirstTry is Governor, GovernorCountingSimple, GovernorVotes, Gove
         return _proposals[proposalId].canceled;
     }
 
-    uint256 _votingDelay;
+    function snapshot(uint256 proposalId) public view returns (uint64) {
+        return _proposals[proposalId].voteStart._deadline;
+    }
 
-    function votingDelay() public view override virtual returns (uint256) {  // HARNESS: pure -> view
-        return _votingDelay;
+    function getExecutor() public view returns (address){
+        return _executor();
     }
 
-    uint256 _votingPeriod;
+    uint256 _votingDelay;
 
-    function votingPeriod() public view override virtual returns (uint256) {  // HARNESS: pure -> view
-        return _votingPeriod;
-    }
+    uint256 _votingPeriod;
 
     mapping(uint256 => uint256) public ghost_sum_vote_power_by_id;
 
@@ -58,21 +58,14 @@ contract WizardFirstTry is Governor, GovernorCountingSimple, GovernorVotes, Gove
         return deltaWeight;        
     }
 
-    function callPropose(address[] memory targets,
-        uint256[] memory values,
-        bytes[] memory calldatas) public virtual returns (uint256) {
-        return super.propose(targets, values, calldatas, "");
+    // original code, harnessed
+
+    function votingDelay() public view override virtual returns (uint256) {     // HARNESS: pure -> view
+        return _votingDelay;                                                    // HARNESS: parametric
     }
 
-    // Harness of castVoteWithReason to be able to impose requirement on the proposal ID.
-    uint256 public _pId_Harness;
-    function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason) 
-        public 
-        override(IGovernor, Governor) 
-        returns (uint256) 
-    {
-        require(proposalId == _pId_Harness);
-        return super.castVoteWithReason(proposalId, support, reason);
+    function votingPeriod() public view override virtual returns (uint256) {    // HARNESS: pure -> view
+        return _votingPeriod;                                                   // HARNESS: parametric
     }
 
     // The following functions are overrides required by Solidity.

+ 0 - 28
certora/scripts/AvengersAssemble.sh

@@ -1,28 +0,0 @@
-for contract in certora/harnesses/Wizard*.sol;
-do
-    for spec in certora/specs/*.spec;
-    do      
-        contractFile=$(basename $contract)
-        specFile=$(basename $spec)
-        echo "Processing ${contractFile%.*} with $specFile"
-        if [ "${contractFile%.*}" = "WizardFirstPriority" ];
-        then
-            certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/$contractFile \
-            --link WizardFirstPriority:token=ERC20VotesHarness \
-            --verify ${contractFile%.*}:certora/specs/$specFile "$@" \
-            --solc solc8.2 \
-            --staging shelly/forSasha \
-            --optimistic_loop \
-            --settings -copyLoopUnroll=4 \
-            --msg "checking $spec on ${contractFile%.*}"
-        else
-            certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/$contractFile \
-            --verify ${contractFile%.*}:certora/specs/$specFile "$@" \
-            --solc solc8.2 \
-            --staging shelly/forSasha \
-            --optimistic_loop \
-            --settings -copyLoopUnroll=4 \
-            --msg "checking $spec on ${contractFile%.*}"
-        fi
-    done
-done

+ 0 - 8
certora/scripts/GovernorCountingSimple.sh

@@ -1,8 +0,0 @@
-certoraRun certora/harnesses/GovernorCountingSimpleHarness.sol \
-    --verify GovernorCountingSimpleHarness:certora/specs/GovernorBase.spec \
-    --solc solc8.0 \
-    --staging \
-    --optimistic_loop \
-    --settings -copyLoopUnroll=4 \
-    --rule doubleVoting \
-    --msg "$1"

+ 0 - 2
certora/scripts/GovernorProposalThreshold.sh

@@ -1,2 +0,0 @@
-certoraRun certora/harnesses/GovernorProposalThresholdHarness.sol \
-    --verify GovernorProposalThresholdHarness:certora/specs/Privileged.spec

+ 0 - 2
certora/scripts/GovernorTimelockCompound.sh

@@ -1,2 +0,0 @@
-certoraRun certora/harnesses/GovernorTimelockCompoundHarness.sol \
-    --verify GovernorTimelockCompoundHarness:certora/specs/Privileged.spec

+ 0 - 2
certora/scripts/GovernorVotes.sh

@@ -1,2 +0,0 @@
-certoraRun certora/harnesses/GovernorVotesHarness.sol \
-    --verify GovernorVotesHarness:certora/specs/Privileged.spec

+ 0 - 2
certora/scripts/GovernorVotesQuorumFractionHarness.sh

@@ -1,2 +0,0 @@
-certoraRun certora/harnesses/GovernorVotesQuorumFractionHarness.sol \
-    --verify GovernorVotesQuorumFractionHarness:certora/specs/Privileged.spec

+ 0 - 9
certora/scripts/check.sh

@@ -1,9 +0,0 @@
-echo "Usage: Contract Spec"
-echo "e.g. GovernorVotes Privileged"
-Contract=$1
-Spec=$2
-shift 2
-certoraRun certora/harnesses/${Contract}Harness.sol \
-    --verify ${Contract}Harness:certora/specs/${Spec}.spec "$@" \
-    --solc solc8.0 --staging --rule noBothExecutedAndCanceled
-