Skip to content
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

Add Certora specs #6

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading