Skip to content

Commit 189a4a7

Browse files
authored
for PR (aave-dao#52)
1 parent 60e2eb0 commit 189a4a7

File tree

2 files changed

+42
-38
lines changed

2 files changed

+42
-38
lines changed

.github/workflows/certora.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: certora
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
37
on:
4-
push:
8+
pull_request:
59
branches:
610
- main
7-
pull_request:
11+
- certora
12+
push:
813
branches:
914
- main
1015

@@ -13,42 +18,36 @@ on:
1318
jobs:
1419
verify:
1520
runs-on: ubuntu-latest
16-
21+
if:
22+
github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' &&
23+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
24+
permissions:
25+
contents: read
26+
statuses: write
27+
pull-requests: write
1728
steps:
18-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
1930
with:
2031
submodules: recursive
2132

22-
- name: Install python
23-
uses: actions/setup-python@v2
24-
with: { python-version: 3.9 }
25-
26-
- name: Install java
27-
uses: actions/setup-java@v1
28-
with: { java-version: "11", java-package: jre }
29-
30-
- name: Install certora cli
31-
run: pip3 install certora-cli==7.6.3
32-
33-
- name: Install solc
34-
run: |
35-
wget https://github.com/ethereum/solidity/releases/download/v0.8.27/solc-static-linux
36-
chmod +x solc-static-linux
37-
sudo mv solc-static-linux /usr/local/bin/solc8.27
38-
39-
- name: Verify rule ${{ matrix.rule }}
33+
- name: Munged
4034
run: |
41-
cd certora
35+
cd certora/
4236
touch applyHarness.patch
4337
make munged
44-
cd ..
45-
certoraRun certora/confs/${{ matrix.rule }}
38+
39+
- uses: Certora/certora-run-action@v1
40+
with:
41+
cli-version: 7.31.0
42+
configurations: |-
43+
certora/confs/rules.conf
44+
solc-versions: 0.8.27
45+
comment-fail-only: false
46+
solc-remove-version-prefix: "0."
47+
job-name: "Certora Prover Run"
48+
certora-key: ${{ secrets.CERTORAKEY }}
49+
install-java: true
4650
env:
47-
CERTORAKEY: ${{ secrets.CERTORAKEY }}
48-
49-
strategy:
50-
fail-fast: false
51-
max-parallel: 16
52-
matrix:
53-
rule:
54-
- rules.conf
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
53+

certora/specs/rules.spec

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ rule updateCaps_validity(env e) {
8181
require capsUpdate.length <= 2; // The length of the array is either 1 or 2.
8282
// Accordingly loop_iter==2
8383
uint i; // this is the entry of the array that we shall look at
84-
require i==1 || i==2;
84+
// require i==1 || i==2;
85+
require i<capsUpdate.length;
8586

8687
require capsUpdate[i].supplyCap != KEEP_CURRENT;
8788
require capsUpdate[i].borrowCap != KEEP_CURRENT;
@@ -112,7 +113,8 @@ rule updateRates_validity(env e) {
112113
require ratesUpdate.length <= 2; // The length of the array is either 1 or 2.
113114
// Accordingly loop_iter==2
114115
uint i; // this is the entry of the array that we shall look at
115-
require i==1 || i==2;
116+
// require i==1 || i==2;
117+
require i<ratesUpdate.length;
116118

117119
require ratesUpdate[i].params.optimalUsageRatio != KEEP_CURRENT;
118120
require ratesUpdate[i].params.baseVariableBorrowRate != KEEP_CURRENT;
@@ -147,7 +149,8 @@ rule updateCollateralSide_validity(env e) {
147149
require collateralUpdate.length <= 2; // The length of the array is either 1 or 2.
148150
// Accordingly loop_iter==2
149151
uint i; // this is the entry of the array that we shall look at
150-
require i==1 || i==2;
152+
// require i==1 || i==2;
153+
require i<collateralUpdate.length;
151154

152155
require collateralUpdate[i].ltv != KEEP_CURRENT;
153156
require collateralUpdate[i].liqThreshold != KEEP_CURRENT;
@@ -185,7 +188,8 @@ rule updateLstPriceCaps_validity(env e) {
185188
require priceCapUpdates.length <= 2; // The length of the array is either 1 or 2.
186189
// Accordingly loop_iter==2
187190
uint i; // this is the entry of the array that we shall look at
188-
require i==1 || i==2;
191+
// require i==1 || i==2;
192+
require i<priceCapUpdates.length;
189193

190194
updateLstPriceCaps(e,priceCapUpdates);
191195

@@ -214,7 +218,8 @@ rule updateStablePriceCaps_validity(env e) {
214218
require priceCapUpdates.length <= 2; // The length of the array is either 1 or 2.
215219
// Accordingly loop_iter==2
216220
uint i; // this is the entry of the array that we shall look at
217-
require i==1 || i==2;
221+
// require i==1 || i==2;
222+
require i<priceCapUpdates.length;
218223

219224

220225
updateStablePriceCaps(e,priceCapUpdates);

0 commit comments

Comments
 (0)