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

Modular Gho Stewards #414

Merged
merged 126 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
1997ee9
forge install: ccip
CheyenneAtapour Jul 8, 2024
de4d2f5
feat: add ability to change bridge limit
CheyenneAtapour Jul 8, 2024
d2f41fa
feat: add change rate limit
CheyenneAtapour Jul 8, 2024
1bc20cd
feat: add arb gho steward
CheyenneAtapour Jul 9, 2024
612ebe4
test: deploy gho pool in base test
CheyenneAtapour Jul 9, 2024
eb204c4
test: update bridge limit
CheyenneAtapour Jul 10, 2024
554ded7
test: update token pool rate limit
CheyenneAtapour Jul 10, 2024
703c063
test: arb gho steward tests wout rate limit
CheyenneAtapour Jul 11, 2024
2b87923
test: rate limit test
CheyenneAtapour Jul 11, 2024
cd06a01
feat: remove ccip dependencies
CheyenneAtapour Jul 18, 2024
d358066
feat: consolidate dependencies to 1 file
CheyenneAtapour Jul 20, 2024
b2d1c93
fix: rename dependency folder
CheyenneAtapour Jul 22, 2024
242aa04
fix: remove unnecessary code
CheyenneAtapour Jul 22, 2024
01acca6
feat: remove struct input for rate limit
CheyenneAtapour Jul 23, 2024
7312cf3
test: add more rate limit tests
CheyenneAtapour Jul 23, 2024
ff72dbf
test: use new remote pool
CheyenneAtapour Jul 23, 2024
0e1b728
feat: initial upload seperated interfaces
CheyenneAtapour Jul 23, 2024
677363a
feat: implement ccip steward
CheyenneAtapour Jul 24, 2024
56cf9d6
feat: implement gsm steward
CheyenneAtapour Jul 24, 2024
01e16d4
feat: implement gho aave steward
CheyenneAtapour Jul 24, 2024
fdf6c2b
fix: add get set facilitators
CheyenneAtapour Jul 24, 2024
c5298a1
chore: prettier
CheyenneAtapour Jul 24, 2024
ab18643
test: deploy new stewards
CheyenneAtapour Jul 25, 2024
e057ad9
test: eth ccip steward
CheyenneAtapour Jul 25, 2024
20ba63f
test: gho aave steward constructor
CheyenneAtapour Jul 25, 2024
c850a0d
test: gho aave steward
CheyenneAtapour Jul 25, 2024
091ce89
test: gho gsm steward
CheyenneAtapour Jul 25, 2024
f5edd0c
test: ccip steward arb
CheyenneAtapour Jul 25, 2024
e0a9b16
test: gho aave steward arb
CheyenneAtapour Jul 25, 2024
1194aa3
fix: remove old stewards
CheyenneAtapour Jul 25, 2024
97ce269
test: bucket capacity manager eth
CheyenneAtapour Jul 25, 2024
9d83320
test: bucket capacity manager arbitrum
CheyenneAtapour Jul 25, 2024
db4aa51
fix: remove gho borrow rate change
CheyenneAtapour Jul 26, 2024
8dd4da7
chore: remove ccip empty dir
CheyenneAtapour Jul 26, 2024
835e347
fix: put inherited interfaces at end per convention
CheyenneAtapour Jul 26, 2024
010ca6f
fix: risk council
CheyenneAtapour Jul 26, 2024
a5652ec
fix: document required roles
CheyenneAtapour Jul 26, 2024
05d78dd
fix: clarify required roles
CheyenneAtapour Jul 26, 2024
861adb5
chore: remove unnecessary comment
CheyenneAtapour Jul 29, 2024
489b7b7
fix: bridge limit flag for ccip steward
CheyenneAtapour Jul 30, 2024
b0d60a9
fix: rename bucket capacity manager
CheyenneAtapour Jul 30, 2024
e1285bf
fix: reorder functions per style guidelines
CheyenneAtapour Jul 30, 2024
eefe810
fix: remove ownable where not required
CheyenneAtapour Jul 30, 2024
279886b
fix: remove unused imports
CheyenneAtapour Jul 30, 2024
236e093
feat: add update gho supply cap
CheyenneAtapour Jul 30, 2024
c2a8c14
test: fuzz rate limit update
CheyenneAtapour Jul 30, 2024
0e01972
fix: grant roles in steward setup
CheyenneAtapour Jul 30, 2024
70ae6fc
fix: enforce bridge limit update conditions
CheyenneAtapour Jul 31, 2024
4c38368
fix: enforce rate limit update conditions
CheyenneAtapour Jul 31, 2024
dd539c4
test: add change ownership test
CheyenneAtapour Jul 31, 2024
135fce9
fix: replace functions with constants
CheyenneAtapour Jul 31, 2024
9359796
fix: change dependency structure
CheyenneAtapour Aug 1, 2024
25edbf7
feat: implement gsm fee strategy factory
CheyenneAtapour Aug 2, 2024
de43b37
fix: reorg files
CheyenneAtapour Aug 2, 2024
1762d1f
feat: add borrow rate update
CheyenneAtapour Aug 3, 2024
2015f8c
fix: use bps instead of ray
CheyenneAtapour Aug 6, 2024
df771f1
test: add back borrow rate tests
CheyenneAtapour Aug 6, 2024
158e021
feat: add all 4 params for borrow rate update
CheyenneAtapour Aug 6, 2024
d53d8e7
fix: rename fixed fee strategy factory
CheyenneAtapour Aug 6, 2024
fe8b115
fix: rename to getStrategyByFees
CheyenneAtapour Aug 6, 2024
7daef90
fix: minor fixes
CheyenneAtapour Aug 6, 2024
a6a6832
fix: remove unnecessary checks
CheyenneAtapour Aug 6, 2024
7e35891
fix: remove unnecessary getter
CheyenneAtapour Aug 6, 2024
5d6c8b8
feat: add timelocks to all steward functions
CheyenneAtapour Aug 7, 2024
586c327
fix: reorder functions
CheyenneAtapour Aug 7, 2024
5cefb60
fix: use internal constant for max borrow rate
CheyenneAtapour Aug 7, 2024
597855b
fix: remove comments
CheyenneAtapour Aug 7, 2024
335fbd1
fix: change from ray to bps
CheyenneAtapour Aug 7, 2024
f8ecd17
fix: name fixedFeeStrategyFactory
CheyenneAtapour Aug 7, 2024
9fb1e29
fix: comments
CheyenneAtapour Aug 7, 2024
3ad1f7e
fix: add docs
CheyenneAtapour Aug 7, 2024
66c7510
fix: remove unused strategy factory
CheyenneAtapour Aug 7, 2024
c8de856
fix: docs
CheyenneAtapour Aug 7, 2024
9e20b2a
test: bridge limit disabled
CheyenneAtapour Aug 7, 2024
d538a77
fix: comments and imports
CheyenneAtapour Aug 7, 2024
a03081b
fix: comments
CheyenneAtapour Aug 7, 2024
64f1ae8
fix: local variable for clarity
CheyenneAtapour Aug 7, 2024
bfe7393
test: revert case for ownership
CheyenneAtapour Aug 7, 2024
3617fd8
test: bucket capacity decrease
CheyenneAtapour Aug 7, 2024
b34db2f
fix: remove unneeded code
CheyenneAtapour Aug 7, 2024
577f656
feat: use pool configurator instead of engine
CheyenneAtapour Aug 8, 2024
561dbbe
fix: remove config engine
CheyenneAtapour Aug 8, 2024
207342d
feat: cut down dependencies
CheyenneAtapour Aug 8, 2024
bd71cd8
feat: put pool into separate file
CheyenneAtapour Aug 8, 2024
0302cdf
feat: cut unnecessary code from ccip pools
CheyenneAtapour Aug 8, 2024
2971b41
fix: put ccip pools in mock folder
CheyenneAtapour Aug 8, 2024
cf1b3d1
fix: move ccip pools to deps
CheyenneAtapour Aug 8, 2024
8b8c5e9
fix: added dev comment link to original
CheyenneAtapour Aug 8, 2024
77b4d54
fix: rename gho bucket steward
CheyenneAtapour Aug 8, 2024
879f742
fix: misc
CheyenneAtapour Aug 8, 2024
29ed300
fix: typo
CheyenneAtapour Aug 8, 2024
3b1123c
fix: do not deploy new borrow rate strategy
CheyenneAtapour Aug 8, 2024
24a6ba9
feat: remove ccip dependency
CheyenneAtapour Aug 9, 2024
81a0ed1
fix: add reduced interface
CheyenneAtapour Aug 9, 2024
1ded1e4
fix: remove unused events
CheyenneAtapour Aug 9, 2024
ab80340
fix: add missing docs
CheyenneAtapour Aug 9, 2024
3a1aadc
fix: function ordering
CheyenneAtapour Aug 9, 2024
2575898
fix: remove unused functions
CheyenneAtapour Aug 9, 2024
9eb0922
fix: remove unused functions
CheyenneAtapour Aug 9, 2024
4d3f137
fix: remove unused events
CheyenneAtapour Aug 9, 2024
957c84f
fix: comment to reflect new name
CheyenneAtapour Aug 9, 2024
1096260
fix: remove unused constant
CheyenneAtapour Aug 18, 2024
d92d7cc
fix: disallow updates with no changed values
CheyenneAtapour Aug 18, 2024
d1fcac2
test: no update checks
CheyenneAtapour Aug 19, 2024
255ddfa
fix: change risk config to borrow config, remove delay
CheyenneAtapour Aug 19, 2024
90770bd
feat: only owner can set borrow rate config
CheyenneAtapour Aug 19, 2024
5115df8
fix: remove check interest rate not set
CheyenneAtapour Aug 19, 2024
ef472d6
fix: update gsm fees works without set strategy
CheyenneAtapour Aug 20, 2024
b050051
test: add 2 of 3 remaining config tests
CheyenneAtapour Aug 20, 2024
2f4eeb7
test: variable rate slope 2 tests
CheyenneAtapour Aug 20, 2024
a229cc1
fix: address pr comments
CheyenneAtapour Aug 21, 2024
7440451
fix: requested changes
CheyenneAtapour Aug 21, 2024
0a09941
fix: requested changes
CheyenneAtapour Aug 22, 2024
a41f8a2
fix: clearer comments and tests
CheyenneAtapour Aug 23, 2024
fe72684
Fix CI (#422)
CheyenneAtapour Sep 4, 2024
4e645f6
test: add fork tests (#416)
CheyenneAtapour Sep 12, 2024
81265c1
fix: Change minimum delay to 1 day
CheyenneAtapour Sep 12, 2024
703087b
fix: Change borrow rate config to 5%
CheyenneAtapour Sep 12, 2024
945fcf8
fix: Change eth fork tests config to 5%
CheyenneAtapour Sep 13, 2024
c8b9c61
fix: Use 5% for config on arbitrum fork tests
CheyenneAtapour Sep 13, 2024
c9d5f9b
fix: Fix solc warnings
miguelmtzinf Sep 13, 2024
c82c63b
fix: add cleanups
miguelmtzinf Sep 13, 2024
f58767b
ci: Certora Review of Modular Gho Steward (#423)
MichaelMorami Sep 16, 2024
1d8a412
fix: Fix lint
miguelmtzinf Sep 16, 2024
82af653
feat: Add initial overview rough draft
CheyenneAtapour Sep 16, 2024
be4e4b6
docs: Rename and format
CheyenneAtapour Sep 17, 2024
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
9 changes: 8 additions & 1 deletion .github/workflows/certora-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:

- name: Install solc
run: |
cd certora/steward/
touch applyHarness.patch
make munged
cd ../..
wget https://github.com/ethereum/solidity/releases/download/v0.8.10/solc-static-linux
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.10
Expand All @@ -48,4 +52,7 @@ jobs:
max-parallel: 16
matrix:
rule:
- rules.conf
- GhoAaveSteward.conf
- GhoBucketSteward.conf
- GhoCcipSteward.conf
- GhoGsmSteward.conf
2 changes: 2 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
env:
ALCHEMY_KEY: '${{secrets.ALCHEMY_KEY}}'
ETH_RPC_URL: 'https://eth-mainnet.g.alchemy.com/v2/${{secrets.ALCHEMY_KEY}}'
RPC_MAINNET: 'https://eth-mainnet.g.alchemy.com/v2/${{secrets.ALCHEMY_KEY}}'
RPC_ARBITRUM: 'https://arb-mainnet.g.alchemy.com/v2/${{secrets.ALCHEMY_KEY}}'
strategy:
matrix:
node-version:
Expand Down
Binary file not shown.
28 changes: 28 additions & 0 deletions certora/steward/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
default: help

PATCH = applyHarness.patch
CONTRACTS_DIR = ../../src
MUNGED_DIR = munged

help:
@echo "usage:"
@echo " make clean: remove all generated files (those ignored by git)"
@echo " make $(MUNGED_DIR): create $(MUNGED_DIR) directory by applying the patch file to $(CONTRACTS_DIR)"
@echo " make record: record a new patch file capturing the differences between $(CONTRACTS_DIR) and $(MUNGED_DIR)"

munged: $(wildcard $(CONTRACTS_DIR)/*.sol) $(PATCH)
rm -rf $@
mkdir $@
cp -r ../../src $@
patch -p0 -d $@ < $(PATCH)

record:
mkdir tmp
cp -r ../../src tmp
diff -ruN tmp $(MUNGED_DIR) | sed 's+tmp/++g' | sed 's+$(MUNGED_DIR)/++g' > $(PATCH)
rm -rf tmp

clean:
git clean -fdX
touch $(PATCH)

7 changes: 7 additions & 0 deletions certora/steward/applyHarness.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff -ruN .gitignore .gitignore
--- .gitignore 1970-01-01 02:00:00.000000000 +0200
+++ .gitignore 2024-08-12 17:28:45.843705526 +0300
@@ -0,0 +1,2 @@
+*
+!.gitignore
\ No newline at end of file
27 changes: 27 additions & 0 deletions certora/steward/conf/GhoAaveSteward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"files": ["certora/steward/harness/GhoAaveSteward_Harness.sol"],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
"aave-stk-v1-5/=lib/aave-stk-v1-5",
"ds-test/=lib/forge-std/lib/ds-test/src",
"forge-std/=lib/forge-std/src",
"aave-address-book/=lib/aave-address-book/src",
"aave-helpers/=lib/aave-stk-v1-5/lib/aave-helpers",
"aave-v3-core/=lib/aave-address-book/lib/aave-v3-core",
"erc4626-tests/=lib/aave-stk-v1-5/lib/openzeppelin-contracts/lib/erc4626-tests",
"openzeppelin-contracts/=lib/aave-stk-v1-5/lib/openzeppelin-contracts",
"solidity-utils/=lib/solidity-utils/src"
],
"build_cache": true,
"optimistic_loop": true,
"process": "emv",
"prover_args": ["-depth 15","-mediumTimeout 1000"],
"smt_timeout": "2000",
"solc": "solc8.10",
"verify": "GhoAaveSteward_Harness:certora/steward/specs/GhoAaveSteward.spec",
"rule_sanity": "basic",
"msg": "GhoAaveSteward: all rules"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"files": [
"certora/steward/harness/GhoStewardV2_Harness.sol",
"src/contracts/facilitators/aave/interestStrategy/FixedRateStrategyFactory.sol"
],
"link": [
"GhoStewardV2_Harness:FIXED_RATE_STRATEGY_FACTORY=FixedRateStrategyFactory",
"src/contracts/misc/GhoBucketSteward.sol"
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
Expand All @@ -21,12 +17,13 @@
"openzeppelin-contracts/=lib/aave-stk-v1-5/lib/openzeppelin-contracts",
"solidity-utils/=lib/solidity-utils/src"
],
"build_cache": true,
"optimistic_loop": true,
"process": "emv",
"prover_args": ["-depth 15","-mediumTimeout 1000"],
"smt_timeout": "2000",
"solc": "solc8.10",
"verify": "GhoStewardV2_Harness:certora/steward/specs/rules.spec",
"verify": "GhoBucketSteward:certora/steward/specs/GhoBucketSteward.spec",
"rule_sanity": "basic",
"msg": "STEWARD: all rules"
"msg": "GhoBucketSteward: all rules"
}
27 changes: 27 additions & 0 deletions certora/steward/conf/GhoCcipSteward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"files": ["certora/steward/harness/GhoCcipSteward_Harness.sol"],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
"aave-stk-v1-5/=lib/aave-stk-v1-5",
"ds-test/=lib/forge-std/lib/ds-test/src",
"forge-std/=lib/forge-std/src",
"aave-address-book/=lib/aave-address-book/src",
"aave-helpers/=lib/aave-stk-v1-5/lib/aave-helpers",
"aave-v3-core/=lib/aave-address-book/lib/aave-v3-core",
"erc4626-tests/=lib/aave-stk-v1-5/lib/openzeppelin-contracts/lib/erc4626-tests",
"openzeppelin-contracts/=lib/aave-stk-v1-5/lib/openzeppelin-contracts",
"solidity-utils/=lib/solidity-utils/src"
],
"build_cache": true,
"optimistic_loop": true,
"process": "emv",
"prover_args": ["-depth 15","-mediumTimeout 1000"],
"smt_timeout": "2000",
"solc": "solc8.10",
"verify": "GhoCcipSteward_Harness:certora/steward/specs/GhoCcipSteward.spec",
"rule_sanity": "basic",
"msg": "GhoCcipSteward: all rules"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"files": [
"certora/steward/harness/GhoStewardV2_Harness.sol",
"src/contracts/facilitators/aave/interestStrategy/FixedRateStrategyFactory.sol"
"certora/steward/harness/GhoGsmSteward_Harness.sol",
"src/contracts/facilitators/gsm/feeStrategy/FixedFeeStrategyFactory.sol"
],
"link": [
"GhoStewardV2_Harness:FIXED_RATE_STRATEGY_FACTORY=FixedRateStrategyFactory",
"GhoGsmSteward_Harness:FIXED_FEE_STRATEGY_FACTORY=FixedFeeStrategyFactory",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
Expand All @@ -21,13 +21,13 @@
"openzeppelin-contracts/=lib/aave-stk-v1-5/lib/openzeppelin-contracts",
"solidity-utils/=lib/solidity-utils/src"
],
"build_cache": true,
"optimistic_loop": true,
"prover_args": ["-depth 15","-mediumTimeout 1000","-cache none"],
"process": "emv",
"prover_args": ["-depth 15","-mediumTimeout 1000"],
"smt_timeout": "2000",
"solc": "solc8.10",
"verify": "GhoStewardV2_Harness:certora/steward/specs/rules.spec",
"rule": ["sanity"],
"disable_auto_cache_key_gen" :true,
"cache" :"none",
"msg": "STEWARD::sanity"
"verify": "GhoGsmSteward_Harness:certora/steward/specs/GhoGsmSteward.spec",
"rule_sanity": "basic",
"msg": "GhoGsmSteward: all rules"
}
24 changes: 24 additions & 0 deletions certora/steward/harness/GhoAaveSteward_Harness.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {GhoAaveSteward} from '../munged/src/contracts/misc/GhoAaveSteward.sol';

contract GhoAaveSteward_Harness is GhoAaveSteward {
constructor(
address owner,
address addressesProvider,
address poolDataProvider,
address ghoToken,
address riskCouncil,
BorrowRateConfig memory borrowRateConfig
)
GhoAaveSteward(
owner,
addressesProvider,
poolDataProvider,
ghoToken,
riskCouncil,
borrowRateConfig
)
{}
}
17 changes: 17 additions & 0 deletions certora/steward/harness/GhoCcipSteward_Harness.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {GhoCcipSteward} from '../../../src/contracts/misc/GhoCcipSteward.sol';

contract GhoCcipSteward_Harness is GhoCcipSteward {
constructor(
address ghoToken,
address ghoTokenPool,
address riskCouncil,
bool bridgeLimitEnabled
) GhoCcipSteward(ghoToken, ghoTokenPool, riskCouncil, bridgeLimitEnabled) {}

function getCcipTimelocks() external view returns (CcipDebounce memory) {
return _ccipTimelocks;
}
}
11 changes: 11 additions & 0 deletions certora/steward/harness/GhoGsmSteward_Harness.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {GhoGsmSteward} from '../../../src/contracts/misc/GhoGsmSteward.sol';

contract GhoGsmSteward_Harness is GhoGsmSteward {
constructor(
address fixedRateStrategyFactory,
address riskCouncil
) GhoGsmSteward(fixedRateStrategyFactory, riskCouncil) {}
}
2 changes: 2 additions & 0 deletions certora/steward/munged/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Loading
Loading