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 24, 2024
1 parent 90c5a20 commit ce3e28d
Show file tree
Hide file tree
Showing 11 changed files with 1,384 additions and 1 deletion.
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-token-bridge:
- l1-token-gateway
- l2-token-gateway

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-token-bridge }}
run: make certora-${{ matrix.arbitrum-token-bridge }} 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/

# Dotenv file
.env

# 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-0.8.21:$(PATH)
certora-l1-token-gateway :; PATH=${PATH} certoraRun certora/L1TokenGateway.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,)
certora-l2-token-gateway :; PATH=${PATH} certoraRun certora/L2TokenGateway.conf$(if $(rule), --rule $(rule),)$(if $(results), --wait_for_results all,)
37 changes: 37 additions & 0 deletions certora/L1TokenGateway.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"files": [
"src/L1TokenGateway.sol",
"certora/harness/Auxiliar.sol",
"test/mocks/InboxMock.sol",
"test/mocks/InboxMock.sol:BridgeMock",
"test/mocks/InboxMock.sol:OutboxMock",
"test/mocks/GemMock.sol",
"certora/harness/ImplementationMock.sol"
],
"solc": "solc-0.8.21",
"solc_optimize_map": {
"L1TokenGateway": "200",
"Auxiliar": "0",
"InboxMock": "0",
"BridgeMock": "0",
"OutboxMock": "0",
"GemMock": "0",
"ImplementationMock": "0"
},
"link": [
"L1TokenGateway:inbox=InboxMock",
"InboxMock:bridge=BridgeMock",
"BridgeMock:activeOutbox=OutboxMock"
],
"verify": "L1TokenGateway:certora/L1TokenGateway.spec",
"rule_sanity": "basic",
"multi_assert_check": true,
"parametric_contracts": ["L1TokenGateway"],
"build_cache": true,
"optimistic_hashing": true,
"hashing_length_bound": "512",
"prover_args": [
"-enableStorageSplitting false"
],
"msg": "L1TokenGateway"
}
Loading

0 comments on commit ce3e28d

Please sign in to comment.