Skip to content

Commit 08cfaa3

Browse files
committed
Merge branch 'main' into certora-squashed
2 parents 596f8ec + 5431379 commit 08cfaa3

File tree

141 files changed

+10839
-814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+10839
-814
lines changed

.github/workflows/comment.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: PR Comment
22

33
on:
44
workflow_run:
5+
# The workflow generating the artifacts
56
workflows: [Test]
67
types:
78
- completed
@@ -12,10 +13,11 @@ permissions:
1213
checks: read
1314
statuses: read
1415
pull-requests: write
15-
contents: write
1616

1717
jobs:
1818
comment:
1919
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
2020
secrets:
21+
# the provided PAT needs write and write permissions on issues and pull requests
22+
# the PAT is only really needed when commenting of prs from forks
2123
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}

.github/workflows/test.yml

+9-70
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This action runs all common tooling for foundry repos
2+
# It does not comment any results though.
3+
# If you want to have comments on your repo, also install comment.yml
14
name: Test
25

36
concurrency:
@@ -7,77 +10,13 @@ concurrency:
710
on:
811
pull_request:
912
push:
10-
branches:
11-
- main
13+
branches: [main]
1214

1315
jobs:
1416
lint:
15-
name: lint
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
21-
with:
22-
node-version-file: .nvmrc
23-
cache: "npm"
24-
25-
- name: install
26-
run: npm ci --prefer-offline --no-audit
27-
28-
- name: lint
29-
run: npm run lint
30-
17+
uses: bgd-labs/github-workflows/.github/workflows/foundry-lint-prettier.yml@main
3118
test:
32-
name: Foundry build n test
33-
runs-on: ubuntu-latest
34-
env:
35-
FOUNDRY_PROFILE: ci
36-
steps:
37-
- uses: actions/checkout@v4
38-
with:
39-
submodules: recursive
40-
41-
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
42-
with:
43-
node-version-file: .nvmrc
44-
cache: "npm"
45-
46-
- name: Install node dependencies
47-
run: npm ci --prefer-offline --no-audit
48-
49-
- name: Run Foundry setup
50-
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@4f16d15e380bbcf7e3933698c08b9fd34e967f78
51-
52-
- name: Run Forge tests
53-
uses: bgd-labs/github-workflows/.github/actions/foundry-test@4f16d15e380bbcf7e3933698c08b9fd34e967f78
54-
55-
- name: Run Gas report
56-
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78
57-
58-
- name: Cleanup
59-
# This test will currently fail on coverage due to the gas limit beaing breached with optimizer disabled
60-
run: rm tests/deployments/DeploymentsGasLimits.t.sol
61-
62-
- name: Run Lcov report
63-
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78
64-
65-
- name: Save PR number
66-
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
67-
env:
68-
PR_NUMBER: ${{ github.event.number }}
69-
run: |
70-
mkdir -p ./pr
71-
echo $PR_NUMBER > /tmp/content/pr_number.txt
72-
73-
- uses: actions/upload-artifact@v4
74-
with:
75-
name: content
76-
path: /tmp/content
77-
78-
# we let failing tests pass so we can log them in the comment, still we want the ci to fail
79-
- name: Post test
80-
if: ${{ env.testStatus != 0 }}
81-
run: |
82-
echo "tests failed"
83-
exit 1
19+
uses: bgd-labs/github-workflows/.github/workflows/foundry-test.yml@main
20+
# only when the repo has zksync code
21+
# test-zk:
22+
# uses: bgd-labs/github-workflows/.github/workflows/foundry-test-zk.yml@main

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ broadcast/
3333
certora-logs
3434
certora_debug_log.txt
3535
resource_errors.json
36+
37+
# invariants
38+
_corpus/
39+
crytic-export/

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ lib
33
cache
44
node_modules
55
report
6+
_corpus
7+
crytic-export
8+
snapshots

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Parameters
1010
Licensor: Aave DAO, represented by its governance smart contracts
1111

1212

13-
Licensed Work: Aave v3.2
14-
The Licensed Work is (c) 2024 Aave DAO, represented by its governance smart contracts
13+
Licensed Work: Aave v3.3
14+
The Licensed Work is (c) 2025 Aave DAO, represented by its governance smart contracts
1515

1616
Additional Use Grant: You are permitted to use, copy, and modify the Licensed Work, subject to
1717
the following conditions:

Makefile

+34-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ coverage :
3333
make coverage-report
3434
make coverage-badge
3535

36+
3637
# Utilities
3738
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
3839
git-diff :
@@ -42,14 +43,44 @@ git-diff :
4243

4344
# Deploy
4445
deploy-libs-one :;
45-
forge script scripts/misc/LibraryPreCompileOne.sol --rpc-url ${chain} --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --slow --broadcast
46+
FOUNDRY_PROFILE=${chain} forge script scripts/misc/LibraryPreCompileOne.sol --rpc-url ${chain} --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --slow --broadcast
4647
deploy-libs-two :;
47-
forge script scripts/misc/LibraryPreCompileTwo.sol --rpc-url ${chain} --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --slow --broadcast
48+
FOUNDRY_PROFILE=${chain} forge script scripts/misc/LibraryPreCompileTwo.sol --rpc-url ${chain} --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --slow --broadcast
4849

4950
deploy-libs :
5051
make deploy-libs-one chain=${chain}
5152
npx catapulta-verify -b broadcast/LibraryPreCompileOne.sol/${chainId}/run-latest.json
5253
make deploy-libs-two chain=${chain}
5354
npx catapulta-verify -b broadcast/LibraryPreCompileTwo.sol/${chainId}/run-latest.json
5455

55-
gas-report :; forge test --fuzz-runs 50 --gas-report
56+
# Gas reports
57+
gas-report :; forge test --mp 'tests/gas/*.t.sol' --isolate
58+
59+
60+
# Invariants
61+
echidna:
62+
echidna tests/invariants/Tester.t.sol --contract Tester --config ./tests/invariants/_config/echidna_config.yaml --corpus-dir ./tests/invariants/_corpus/echidna/default/_data/corpus
63+
64+
echidna-assert:
65+
echidna tests/invariants/Tester.t.sol --contract Tester --test-mode assertion --config ./tests/invariants/_config/echidna_config.yaml --corpus-dir ./tests/invariants/_corpus/echidna/default/_data/corpus
66+
67+
echidna-explore:
68+
echidna tests/invariants/Tester.t.sol --contract Tester --test-mode exploration --config ./tests/invariants/_config/echidna_config.yaml --corpus-dir ./tests/invariants/_corpus/echidna/default/_data/corpus
69+
70+
# Medusa
71+
medusa:
72+
medusa fuzz --config ./medusa.json
73+
74+
# Echidna Runner
75+
76+
HOST = power-runner
77+
LOCAL_FOLDER = ./
78+
REMOTE_FOLDER = ./echidna-runner
79+
REMOTE_COMMAND = cd $(REMOTE_FOLDER)/aave-v3-origin && make echidna > process_output.log 2>&1
80+
REMOTE_COMMAND_ASSERT = cd $(REMOTE_FOLDER)/aave-v3-origin && make echidna-assert > process_output.log 2>&1
81+
82+
echidna-runner:
83+
tar --exclude='./tests/invariants/_corpus' -czf - $(LOCAL_FOLDER) | ssh $(HOST) "export PATH=$$PATH:/root/.local/bin:/root/.foundry/bin && mkdir -p $(REMOTE_FOLDER)/aave-v3-origin && tar -xzf - -C $(REMOTE_FOLDER)/aave-v3-origin && $(REMOTE_COMMAND)"
84+
85+
echidna-assert-runner:
86+
tar --exclude='./tests/invariants/_corpus' -czf - $(LOCAL_FOLDER) | ssh $(HOST) "export PATH=$$PATH:/root/.local/bin:/root/.foundry/bin && mkdir -p $(REMOTE_FOLDER)/aave-v3-origin && tar -xzf - -C $(REMOTE_FOLDER)/aave-v3-origin && $(REMOTE_COMMAND_ASSERT)"

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ The following are the security procedures historically applied to Aave v3.X vers
106106

107107
<br>
108108

109+
**-> Aave v3.3 - January 2025**
110+
111+
#### Deficit tracking & Liquidation optimizations
112+
113+
- [Certora](./audits/2024-11-07_Certora_Aave-v3.3.0.pdf)
114+
- [StErMi](./audits/2024-10-22_StErMi_Aave-v3.3.pdf)
115+
- [Oxorio](./audits/2025-01-29_Oxorio_Aave-v3.3.0.pdf)
116+
- [Sherlock](./audits/2025-01-22_Sherlock_Aave-v3.3.0.pdf)
117+
118+
In addition, Enigma Dark has adapted the Foundry-based fuzzing [invariant suite](./tests/invariants) to the Aave v3.3 codebase.
119+
120+
<br>
121+
109122
### Bug bounty
110123

111124
This repository will be subjected to [this bug bounty](https://immunefi.com/bounty/aave/) once the Aave Governance upgrades the smart contracts in the applicable production instances.

0 commit comments

Comments
 (0)