-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Certora specs + configure CI for tests and Certora
- Loading branch information
1 parent
efc415c
commit d60a326
Showing
12 changed files
with
648 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Certora | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
certora: | ||
name: Certora | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
vote-delegate: | ||
- vote-delegate | ||
- vote-delegate-factory | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
java-package: jre | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install solc-select | ||
run: pip3 install solc-select | ||
|
||
- name: Solc Select 0.8.21 | ||
run: solc-select install 0.8.21 | ||
|
||
- name: Install Certora | ||
run: pip3 install certora-cli-beta | ||
|
||
- name: Verify ${{ matrix.vote-delegate }} | ||
run: make certora-${{ matrix.vote-delegate }} results=1 | ||
env: | ||
CERTORAKEY: ${{ secrets.CERTORAKEY }} |
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,36 @@ | ||
name: test | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: test | ||
env: | ||
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }} |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/out | ||
/cache | ||
|
||
# Certora | ||
.certora_internal |
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,3 @@ | ||
PATH := ~/.solc-select/artifacts/solc-0.8.21:$(PATH) | ||
certora-vote-delegate :; PATH=${PATH} certoraRun certora/VoteDelegate.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,) | ||
certora-vote-delegate-factory :; PATH=${PATH} certoraRun certora/VoteDelegateFactory.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,) |
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,37 @@ | ||
{ | ||
"files": [ | ||
"src/VoteDelegate.sol", | ||
"certora/harness/GovMock.sol", | ||
"certora/harness/IouMock.sol", | ||
"certora/harness/ChiefMock.sol", | ||
"certora/harness/PollingMock.sol" | ||
], | ||
"solc_map": { | ||
"VoteDelegate": "solc-0.8.21", | ||
"GovMock": "solc-0.8.21", | ||
"IouMock": "solc-0.8.21", | ||
"ChiefMock": "solc-0.8.21", | ||
"PollingMock": "solc-0.8.21" | ||
}, | ||
"solc_optimize_map": { | ||
"VoteDelegate": "200", | ||
"GovMock": "200", | ||
"IouMock": "200", | ||
"ChiefMock": "200", | ||
"PollingMock": "200" | ||
}, | ||
"link": [ | ||
"VoteDelegate:gov=GovMock", | ||
"VoteDelegate:chief=ChiefMock", | ||
"VoteDelegate:polling=PollingMock", | ||
"ChiefMock:GOV=GovMock", | ||
"ChiefMock:IOU=IouMock" | ||
], | ||
"verify": "VoteDelegate:certora/VoteDelegate.spec", | ||
"rule_sanity": "basic", | ||
"optimistic_loop": true, | ||
"multi_assert_check": true, | ||
"parametric_contracts": ["VoteDelegate"], | ||
"build_cache": true, | ||
"msg": "VoteDelegate" | ||
} |
Oops, something went wrong.