-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d668f95
commit 7c3f573
Showing
13 changed files
with
110 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,10 @@ docs/ | |
|
||
# Certora | ||
.certora_internal/ | ||
.hypothesis/ | ||
.hypothesis/ | ||
|
||
annotated* | ||
gambit* | ||
mutations* | ||
|
||
collect.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/invariant-break/formal-verification/certora/conf/FVCatchesInvariant.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"files": [ | ||
"./test/invariant-break/formal-verification/certora/harness/FVCatchesHarness.sol", | ||
], | ||
"verify": "FVCatchesHarness:./test/invariant-break/formal-verification/certora/spec/FVCatchesInvariant.spec", | ||
"wait_for_results": "all", | ||
"rule_sanity": "basic", | ||
"optimistic_loop": true, | ||
"msg": "Verification of FVCatchesHarness" | ||
} |
20 changes: 20 additions & 0 deletions
20
test/invariant-break/formal-verification/certora/harness/FVCatchesHarness.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.20; | ||
|
||
import {FormalVerificationCatches} from "../../../../../src/invariant-break/FormalVerificationCatches.sol"; | ||
|
||
contract FVCatchesHarness { | ||
FormalVerificationCatches public fvc; | ||
|
||
constructor() { | ||
fvc = new FormalVerificationCatches(); | ||
} | ||
|
||
function tryCatchHellFunc(uint128 number) public view returns (bool) { | ||
try fvc.hellFunc(number) returns (uint256) { | ||
return true; | ||
} catch { | ||
return false; | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
test/invariant-break/formal-verification/certora/mconf/mutation.mconf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"gambit": { | ||
"filename": "test/invariant-break/formal-verification/certora/harness/FVCatchesHarness.sol", | ||
"solc": "solc", | ||
"num_mutants": 3, | ||
"solc_allow_paths": [ | ||
"." | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/invariant-break/formal-verification/certora/spec/FVCatchesInvariant.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* ./src/invariant-break/FormalVerificationCatches.sol | ||
* | ||
* Certora Formal Verification Spec | ||
*/ | ||
|
||
methods { | ||
function tryCatchHellFunc(uint128) external returns bool envfree; | ||
} | ||
|
||
// This is technically unsound... and doesn't work anyways! | ||
invariant hell_func_never_reverts(uint128 number) | ||
tryCatchHellFunc(number) == true | ||
{ | ||
preserved with (env e) { require e.msg.sender != 0; } | ||
} |