Skip to content

Commit 5431379

Browse files
authored
Merge pull request aave-dao#87 from bgd-labs/v3.3.0
V3.3.0
2 parents 083bd38 + aa774ee commit 5431379

File tree

155 files changed

+11416
-961
lines changed

Some content is hidden

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

155 files changed

+11416
-961
lines changed

.github/workflows/comment.yml

Lines changed: 3 additions & 0 deletions
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
@@ -17,4 +18,6 @@ jobs:
1718
comment:
1819
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
1920
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
2023
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}

.github/workflows/test.yml

Lines changed: 9 additions & 70 deletions
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@d738561b5afce35ca3752b28236c9dd68a3fa822
51-
52-
- name: Run Forge tests
53-
uses: bgd-labs/github-workflows/.github/actions/foundry-test@d738561b5afce35ca3752b28236c9dd68a3fa822
54-
55-
- name: Run Gas report
56-
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@d738561b5afce35ca3752b28236c9dd68a3fa822
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@d738561b5afce35ca3752b28236c9dd68a3fa822
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ lib
33
cache
44
node_modules
55
report
6+
_corpus
7+
crytic-export
68
snapshots

LICENSE

Lines changed: 2 additions & 2 deletions
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

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test-contract :; forge test --match-contract ${filter} -vvv
1111
test-watch :; forge test --watch -vvv --no-match-contract DeploymentsGasLimits
1212

1313
# Coverage
14-
coverage-base :; forge coverage --report lcov --no-match-coverage "(scripts|tests|deployments|mocks)"
14+
coverage-base :; forge coverage --fuzz-runs 50 --report lcov --no-match-coverage "(scripts|tests|deployments|mocks)"
1515
coverage-clean :; lcov --rc derive_function_end_line=0 --remove ./lcov.info -o ./lcov.info.p \
1616
'src/contracts/extensions/v3-config-engine/*' \
1717
'src/contracts/treasury/*' \
@@ -33,24 +33,54 @@ coverage :
3333
make coverage-report
3434
make coverage-badge
3535

36-
# Gas reports
37-
forge test --mp 'tests/gas/*.t.sol' --isolate
3836

3937
# Utilities
4038
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
4139
git-diff :
4240
@mkdir -p diffs
43-
@npx prettier ${before} ${after} --write
41+
# @npx prettier ${before} ${after} --write
4442
@printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md
4543

4644
# Deploy
4745
deploy-libs-one :;
48-
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
4947
deploy-libs-two :;
50-
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
5149

5250
deploy-libs :
5351
make deploy-libs-one chain=${chain}
5452
npx catapulta-verify -b broadcast/LibraryPreCompileOne.sol/${chainId}/run-latest.json
5553
make deploy-libs-two chain=${chain}
5654
npx catapulta-verify -b broadcast/LibraryPreCompileTwo.sol/${chainId}/run-latest.json
55+
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

Lines changed: 13 additions & 0 deletions
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)