Skip to content

Commit

Permalink
Add Certora specs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunbreak1211 committed Oct 25, 2024
1 parent 370f3da commit 789adb4
Show file tree
Hide file tree
Showing 10 changed files with 697 additions and 5 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/certora.yml
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:
arbitrum-farms:
- l1-farm-proxy
- l2-farm-proxy

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.arbitrum-farms }}
run: make certora-${{ matrix.arbitrum-farms }} results=1
env:
CERTORAKEY: ${{ secrets.CERTORAKEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ docs/
.env

deployed-[0-9]*.json

# Certora
.certora_internal
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PATH := ~/.solc-select/artifacts/:~/.solc-select/artifacts/solc-0.8.21:$(PATH)
certora-l1-farm-proxy :; PATH=${PATH} certoraRun certora/L1FarmProxy.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,)
certora-l2-farm-proxy :; PATH=${PATH} certoraRun certora/L2FarmProxy.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,)
30 changes: 30 additions & 0 deletions certora/L1FarmProxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"files": [
"src/L1FarmProxy.sol",
"certora/harness/Auxiliar.sol",
"test/mocks/L1TokenGatewayMock.sol",
"test/mocks/InboxMock.sol",
"test/mocks/GemMock.sol",
],
"solc": "solc-0.8.21",
"solc_optimize_map": {
"L1FarmProxy": "200",
"Auxiliar": "0",
"L1TokenGatewayMock": "0",
"InboxMock": "0",
"GemMock": "0"
},
"link": [
"L1FarmProxy:l1Gateway=L1TokenGatewayMock",
"L1FarmProxy:inbox=InboxMock"
],
"verify": "L1FarmProxy:certora/L1FarmProxy.spec",
"rule_sanity": "basic",
"multi_assert_check": true,
"parametric_contracts": ["L1FarmProxy"],
"build_cache": true,
"optimistic_hashing": true,
"optimistic_fallback": true,
"hashing_length_bound": "512",
"msg": "L1FarmProxy"
}
Loading

0 comments on commit 789adb4

Please sign in to comment.