cleaning in process

pull/2997/head
Aleksander Kryukov 3 years ago
parent 37725a0f2c
commit 73080c79d0
  1. 3
      certora/harnesses/WizardFirstPriority.sol
  2. 35
      certora/harnesses/WizardFirstTry.sol
  3. 28
      certora/scripts/AvengersAssemble.sh
  4. 8
      certora/scripts/GovernorCountingSimple.sh
  5. 2
      certora/scripts/GovernorProposalThreshold.sh
  6. 2
      certora/scripts/GovernorTimelockCompound.sh
  7. 2
      certora/scripts/GovernorVotes.sh
  8. 2
      certora/scripts/GovernorVotesQuorumFractionHarness.sh
  9. 9
      certora/scripts/check.sh

@ -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

@ -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.

@ -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

@ -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"

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

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

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

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

@ -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
Loading…
Cancel
Save