Skip to content

Commit 4a085bf

Browse files
authored
Add Certora specs (#3)
1 parent b9eaaec commit 4a085bf

File tree

7 files changed

+1118
-0
lines changed

7 files changed

+1118
-0
lines changed

.github/workflows/certora.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Certora
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
certora:
7+
name: Certora
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- uses: actions/setup-java@v2
19+
with:
20+
distribution: 'zulu'
21+
java-version: '11'
22+
java-package: jre
23+
24+
- name: Set up Python 3.13
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Install solc-select
30+
run: pip3 install solc-select
31+
32+
- name: Solc Select 0.8.24
33+
run: solc-select install 0.8.24
34+
35+
- name: Install Certora
36+
run: pip3 install certora-cli-beta
37+
38+
- name: Verify nfat
39+
run: make certora-nfat results=1
40+
env:
41+
CERTORAKEY: ${{ secrets.CERTORAKEY }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ docs/
1212

1313
# Dotenv file
1414
.env
15+
16+
# Certora
17+
.certora_internal

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PATH := ~/.solc-select/artifacts/:~/.solc-select/artifacts/solc-0.8.24:$(PATH)
2+
certora-nfat :; PATH=${PATH} certoraRun certora/NFATFacility.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,)

certora/NFATFacility.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"files": [
3+
"src/NFATFacility.sol",
4+
"certora/harness/GemMock.sol",
5+
"certora/harness/IdentityNetworkMock.sol"
6+
],
7+
"verify": "NFATFacility:certora/NFATFacility.spec",
8+
"link": ["NFATFacility:gem=GemMock"],
9+
"solc": "solc-0.8.24",
10+
"solc_evm_version": "cancun",
11+
"packages": ["openzeppelin-contracts=lib/openzeppelin-contracts"],
12+
"optimistic_loop": true,
13+
"loop_iter": 3,
14+
"rule_sanity": "basic",
15+
"multi_assert_check": true,
16+
"optimistic_hashing": true,
17+
"parametric_contracts": ["NFATFacility"],
18+
"msg": "NFATFacility"
19+
}

0 commit comments

Comments
 (0)