-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add new gho-aave-steward on prime instance #615
base: main
Are you sure you want to change the base?
Add new gho-aave-steward on prime instance #615
Conversation
This reverts commit d64400c.
...ewardOnAavePrimeInstance/AaveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance_20250129.sol
Show resolved
Hide resolved
...aveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance/ExtendGHOStewardOnAavePrimeInstance.md
Outdated
Show resolved
Hide resolved
…tance/ExtendGHOStewardOnAavePrimeInstance.md Co-authored-by: Harsh Pandey <[email protected]>
🌈Test ResultsCompiling 324 files with Solc 0.8.22 Solc 0.8.22 finished in 158.81s Compiler run successful with warnings: Warning (2018): Function state mutability can be restricted to pure --> lib/aave-helpers/src/ProtocolV2TestBase.sol:664:3: | 664 | function _logReserveConfig(ReserveConfig memory config) internal view { | ^ (Relevant source part starts here and spans across multiple lines).Ran 5 tests for src/20250129_AaveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance/AaveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance_20250129.t.sol:AaveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance_20250129_Test Ran 1 test suite in 414.59ms (413.12ms CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests) |
src/20250129_AaveV3EthereumLido_ExtendGHOStewardOnAavePrimeInstance/ReserveConfiguration.sol
Outdated
Show resolved
Hide resolved
function test_ghoAaveSteward_updateGhoBorrowCap() public { | ||
executePayload(vm, address(proposal)); | ||
|
||
uint256 currentBorrowCap = _getGhoBorrowCap(); | ||
uint256 newBorrowCap = currentBorrowCap + 1; | ||
vm.startPrank(RISK_COUNCIL); | ||
IGhoAaveSteward(proposal.NEW_GHO_AAVE_STEWARD()).updateGhoBorrowCap(newBorrowCap); | ||
assertEq(_getGhoBorrowCap(), newBorrowCap); | ||
} | ||
|
||
function test_ghoAaveSteward_updateGhoSupplyCap() public { | ||
uint256 configValue = 830948836238514615306439858845646848; | ||
vm.mockCall( | ||
address(AaveV3EthereumLido.POOL), | ||
abi.encodeWithSelector(AaveV3EthereumLido.POOL.getConfiguration.selector), | ||
abi.encode(configValue) | ||
); | ||
|
||
uint256 currentSupplyCap = _getGhoSupplyCap(); | ||
assertEq(currentSupplyCap, 10); | ||
uint256 newSupplyCap = currentSupplyCap + 1; | ||
|
||
executePayload(vm, address(proposal)); | ||
|
||
IGhoAaveSteward steward = IGhoAaveSteward(proposal.NEW_GHO_AAVE_STEWARD()); | ||
|
||
vm.startPrank(RISK_COUNCIL); | ||
steward.updateGhoSupplyCap(newSupplyCap); | ||
vm.stopPrank(); | ||
|
||
vm.clearMockedCalls(); | ||
|
||
assertEq(_getGhoSupplyCap(), newSupplyCap); | ||
} | ||
|
||
function test_ghoAaveSteward_revertsChangeOverMax() public { | ||
executePayload(vm, address(proposal)); | ||
|
||
uint256 currentSupplyCap = _getGhoSupplyCap(); | ||
assertEq(currentSupplyCap, 20000000); | ||
uint256 newSupplyCap = 2 * currentSupplyCap + 1; | ||
|
||
IGhoAaveSteward steward = IGhoAaveSteward(proposal.NEW_GHO_AAVE_STEWARD()); | ||
|
||
// Can't update supply cap even by 1 since it's 0, and 100% of 0 is 0 | ||
vm.expectRevert('INVALID_SUPPLY_CAP_UPDATE'); | ||
vm.startPrank(RISK_COUNCIL); | ||
steward.updateGhoSupplyCap(newSupplyCap); | ||
vm.stopPrank(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On forum there's nothing about ability for supply/borrow cap changes. However contract can change them and this possibility is not restricted in any way, the only limit I see is 100%. Risk council can change on any amount less than 100%.
A new GhoAaveSteward is to be deployed, with the Prime configuration:
Owner: 0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A
Addresses Provider: 0xcfBf336fe147D643B9Cb705648500e101504B16d
Pool Data Provider: 0x08795CFE08C7a81dCDFf482BbAAF474B240f31cD
Gho Token: 0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f
Risk Council: 0x8513e6F37dBc52De87b166980Fa3F50639694B60
BorrowRateConfig:
Then, the GhoAaveSteward is to be granted the following permissions:
GhoAaveSteward