-
Notifications
You must be signed in to change notification settings - Fork 5
Colin@verif/setup #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9bb8b16
chore: ignore emacs
colin-morpho 9c5083a
feat: trivial setup for certora prover
colin-morpho 57bdba7
feat: setup certora in ci
colin-morpho a29c6b1
chore: add verification README
colin-morpho 7363a86
feat: rentrancy-safety spec
colin-morpho 390891c
chore: ignore verification related munged files
colin-morpho eb30d6a
chore: provide reentrancy safety documentation
colin-morpho 1603b4c
feat: strenghten reentrancy specification
colin-morpho e666d77
feat:verif immutability
colin-morpho 5c60ef2
fix: remove MB link
colin-morpho 0ea070a
fix: MorphoBlue -> Morpho
colin-morpho 7813f88
fix: remove munging
colin-morpho 1e77059
fix: add sload hook
colin-morpho 9525aa5
fix: add /nl in gitignore
colin-morpho d0f2c10
fix: imrpove description of reentrancy verification
colin-morpho d389ee0
fix: fix description of reentrancy verification
colin-morpho 83988c4
chore: remove certora/munged from gitignore
colin-morpho e3e54e5
fix: apply suggestion to README
colin-morpho 9aa7aea
fix: remove natspec from harness
colin-morpho c8742e3
fix: reentrant -> reentrancy safe
colin-morpho 41e374f
Merge branch 'colin@verif/setup' into colin@verif/reentrancy-safety
colin-morpho 9cb3ee3
fix: remove munging instruction
colin-morpho c6e9d1c
Merge branch 'colin@verif/setup' into colin@verif/reentrancy-safety
colin-morpho 1915cf5
Merge branch 'colin@verif/reentrancy-safety' into colin@verif/immutab…
colin-morpho 6a913b1
chore: update verif's README
colin-morpho a6b961d
Merge pull request #15 from morpho-org/colin@verif/reentrancy-safety
QGarchery e3e2d20
Merge branch 'colin@verif/setup' into colin@verif/immutability
colin-morpho d079c5c
fix: improve description in README
colin-morpho 8d83c5f
Merge branch 'feat/licence' into colin@verif/setup
colin-morpho cfa7091
fix: update PreLiquidationHarness contract interface
colin-morpho 39fca0d
Merge branch 'colin@verif/setup' into colin@verif/immutability
colin-morpho 25eca60
fix: update immutability conf
colin-morpho f17e468
fix: readability + simplify certora conf
colin-morpho 00d8de9
Merge pull request #25 from morpho-org/colin@verif/immutability
colin-morpho fbc1e45
Merge branch 'main' into colin@verif/setup
colin-morpho d88bf7e
fix: implement quentin's suggestions
colin-morpho 7463846
chore:remove pre-liquidation harness
colin-morpho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,52 @@ | ||
name: Certora | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
verify: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
conf: | ||
- Dummy | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ">=3.11" | ||
|
||
- name: Install certora | ||
run: pip install certora-cli | ||
|
||
- name: Install solc (0.8.19) | ||
run: | | ||
wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux | ||
chmod +x solc-static-linux | ||
sudo mv solc-static-linux /usr/local/bin/solc-0.8.19 | ||
|
||
- name: Install solc (0.8.27) | ||
run: | | ||
wget https://github.com/ethereum/solidity/releases/download/v0.8.27/solc-static-linux | ||
chmod +x solc-static-linux | ||
sudo mv solc-static-linux /usr/local/bin/solc-0.8.27 | ||
|
||
- name: Apply munging | ||
run: make -C certora munged | ||
|
||
- name: Verify ${{ matrix.conf }} specification | ||
run: certoraRun certora/confs/${{ matrix.conf }}.conf | ||
env: | ||
CERTORAKEY: ${{ secrets.CERTORAKEY }} |
This file contains hidden or 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 |
---|---|---|
|
@@ -14,3 +14,9 @@ docs/ | |
.env | ||
|
||
.prettierignore | ||
|
||
# Emacs | ||
*~ | ||
|
||
# Certora | ||
.certora_internal |
This file contains hidden or 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,12 @@ | ||
munged: $(wildcard ../src/*.sol) applyMunging.patch | ||
@rm -rf munged | ||
@cp -r ../src munged | ||
@patch -p0 -d munged < applyMunging.patch | ||
|
||
record: | ||
diff -ruN ../src munged | sed 's+\.\./src/++g' | sed 's+munged/++g' > applyMunging.patch | ||
|
||
clean: | ||
rm -rf munged | ||
|
||
.PHONY: help clean # do not add munged here, as it is useful to protect munged edits |
This file contains hidden or 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,49 @@ | ||
# Pre-liquidation Contract Formal Verification | ||
|
||
This folder contains the | ||
[CVL](https://docs.certora.com/en/latest/docs/cvl/index.html) | ||
specification and verification setup for the | ||
[pre-liquidation](../src/PreLiquidation.sol) contract using the | ||
[Certora Prover](https://www.certora.com/). | ||
|
||
## Getting Started | ||
|
||
This project depends on two different versions of | ||
[Solidity](https://soliditylang.org/) which are required for running | ||
the verification. The compiler binaries should be available under the | ||
following path names: | ||
|
||
- `solc-0.8.19` for the solidity compiler version `0.8.19`, which is | ||
used for `Morpho`; | ||
- `solc-0.8.27` for the solidity compiler version `0.8.27`, which is | ||
used for `PreLiquidation`. | ||
|
||
The verification is performed on modified source files, which can be | ||
generated by running the following command. | ||
|
||
``` shell | ||
make -C certora munged | ||
``` | ||
|
||
### Installing the Certora Prover | ||
|
||
The Certora CLI can be installed by running `python3 -m pip3 install | ||
certora-cli`. Detailed installation instructions can be found on | ||
Certora's official | ||
[documentation](https://docs.certora.com/en/latest/docs/user-guide/install.html). | ||
MathisGD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To verifying a specification, run the command `certoraRun Spec.conf` | ||
where `Spec.conf` is the configuration file of the matching CVL | ||
specification. Configuration files are available in | ||
[`certora/conf`](./confs). Please ensure that `CERTORA_KEY` is set up | ||
QGarchery marked this conversation as resolved.
Show resolved
Hide resolved
|
||
in your environment. | ||
|
||
## Overview | ||
|
||
The PreLiquidation contract enables Morpho Blue borrowers to set up a | ||
safer liquidation plan on a given position, thus preventing undesired | ||
liquidations. | ||
MathisGD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## TODO | ||
|
||
- [ ] Provide an overview of the specification. |
Empty file.
This file contains hidden or 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,18 @@ | ||
{ | ||
"files": [ | ||
"certora/helpers/Dummy.sol", | ||
], | ||
"solc": "solc-0.8.27", | ||
"verify": "Dummy:certora/specs/Dummy.spec", | ||
"loop_iter": "2", | ||
"optimistic_loop": true, | ||
"prover_args": [ | ||
"-depth 3", | ||
"-mediumTimeout 20", | ||
"-timeout 120", | ||
"-superOptimisticReturnsize true", | ||
], | ||
"rule_sanity": "basic", | ||
"server": "production", | ||
"msg": "PreLiquidation Dummy", | ||
} |
This file contains hidden or 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 @@ | ||
contract Dummy {} |
This file contains hidden or 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,2 @@ | ||
invariant tt() | ||
true; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.