Skip to content

Commit 42b67ff

Browse files
feat: 3.2.0 activation (#466)
Co-authored-by: Harsh Pandey <[email protected]>
1 parent a62a21d commit 42b67ff

7 files changed

+491
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Raw diff
2+
3+
```json
4+
{}
5+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
5+
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
6+
7+
/**
8+
* @title Audit cost reimbursement
9+
* @author BGD labs
10+
* - Discussion: https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/4#p-48735-activation-stage-3
11+
*/
12+
contract AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924 is IProposalGenericExecutor {
13+
address public constant BGD_RECEIVER = 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF;
14+
15+
function execute() external {
16+
AaveV3Ethereum.COLLECTOR.transfer(
17+
AaveV3EthereumAssets.GHO_UNDERLYING,
18+
BGD_RECEIVER,
19+
76_000 ether
20+
);
21+
}
22+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
5+
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
6+
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
7+
import {AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924} from './AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol';
8+
9+
/**
10+
* @dev Test for AaveV3Ethereum_GHOBorrowRateUpdate_20240814
11+
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.t.sol -vv
12+
*/
13+
contract AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_Test is ProtocolV3TestBase {
14+
address public constant BGD_RECEIVER = 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF;
15+
uint256 public constant AUDIT_COST = 76_000 ether;
16+
AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924 internal proposal;
17+
18+
function setUp() public {
19+
vm.createSelectFork(vm.rpcUrl('mainnet'), 20872348);
20+
proposal = new AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924();
21+
}
22+
23+
/**
24+
* @dev executes the generic test suite including e2e and config snapshots
25+
*/
26+
function test_defaultProposalExecution() public {
27+
uint256 collectorBalanceBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(
28+
address(AaveV3Ethereum.COLLECTOR)
29+
);
30+
uint256 bgdBalanceBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(BGD_RECEIVER);
31+
defaultTest(
32+
'AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924',
33+
AaveV3Ethereum.POOL,
34+
address(proposal)
35+
);
36+
uint256 collectorBalanceAfter = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(
37+
address(AaveV3Ethereum.COLLECTOR)
38+
);
39+
uint256 bgdBalanceAfter = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(BGD_RECEIVER);
40+
assertEq(collectorBalanceBefore - AUDIT_COST, collectorBalanceAfter);
41+
assertEq(bgdBalanceBefore + AUDIT_COST, bgdBalanceAfter);
42+
}
43+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: "Upgrade all Aave instances to 3.2"
3+
author: "BGD Labs @bgdlabs"
4+
discussions: "https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/3"
5+
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x68ce69b5e71df1d77c2ad814a5d41162a40be54473576ff590d0b1bb5afde4a7"
6+
---
7+
8+
## Simple Summary
9+
10+
Upgrades all active Aave instances to Aave 3.2 which debuts "Liquid eModes" and fully deprecated stable borrowing.
11+
12+
## Motivation
13+
14+
EModes have been a powerful feature since the inception of Aave v3.
15+
Liquid eModes builds on this success by increase the flexibility in configuring eModes. With Liquid eModes it is now possible, to have a single asset be listed in multiple eModes.
16+
At the same time, it's possible to granularly control which assets are collateral and borrowable inside an eMode.
17+
18+
Stable debt has been off-boarded from Aave v3 for quite some time. What was remaining on the protocol code were merely artifacts that increased gas consumption and code size.
19+
Therefore the 3.2 release removes these artifacts in a backwards compatible way.
20+
21+
_In addition to the upgrade itself, the proposal payload includes reimbursement of $76’000 denominated in GHO, to cover the cost of extra external security procedures incurred._
22+
23+
## Specification
24+
25+
Aave 3.2 focuses on two main areas of the aave protocol:
26+
27+
- The final deprecation of stable borrowing
28+
- Improvements on the eModes, introducing "Liquid eModes"
29+
30+
The proposal will execute to following operations on each active Aave v3 pool:
31+
32+
- Upgrade the Pool/L2Pool implementation to 3.2, which will internally set the stableDebtToken address to `address(0)` on all assets
33+
- Upgrade the PoolConfigurator implementation to 3.2
34+
- Deploy new ProtocolDataProvider compatible with v3.2, and set it on the addresses provider contract
35+
- Migrate all assets currently in eMode to be both borrowable & collateral in eMode
36+
- Migrate the InterestRateStrategy to a new version without stable rate calculations
37+
38+
An additional payload will transfer `76,000.00` GHO to the BGD-controlled address `0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF`.
39+
40+
## Security procedures
41+
42+
In addition to unit tests & integration test suites, the changes have been audited in 5 audits by 4 independent auditors:
43+
44+
### Stable Rate and Liquid eModes
45+
46+
- [Certora](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-10_Certora_Aave-v3.2_Stable_Rate_Removal.pdf)
47+
- [Enigma Dark](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-30_Enigma_Aave-v3.2.pdf)
48+
49+
### Liquid eModes
50+
51+
- [Certora](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-19_Certora_Aave-v3.2_Liquid_eModes.pdf)
52+
- [Oxorio](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-12_Oxorio_Aav3-v3.2.pdf)
53+
- [Pashov](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-15_Pashov_Aave-v3.2.pdf)
54+
55+
## References
56+
57+
- [Payload Implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/UpgradePayload.sol)
58+
- [New initialization logic of Pool](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/CustomInitialize.sol)
59+
- [New L1 pool implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/PoolInstance.sol)
60+
- [New L2 pool implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/L2PoolInstance.sol)
61+
- [Payload Tests](https://github.com/bgd-labs/protocol-v3.2-upgrade/tree/main/tests)
62+
- [Live-code and post execution state diffs](https://github.com/bgd-labs/protocol-v3.2-upgrade/tree/main/diffs)
63+
- [PoolDiff](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/3.1_3.2_L2PoolDiff.md), [PoolConfiguratorDiff](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/3.1-3.2_PoolConfiguratorDiff.md)
64+
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x68ce69b5e71df1d77c2ad814a5d41162a40be54473576ff590d0b1bb5afde4a7)
65+
- [Discussion](https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/3)
66+
- [Migration guide](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/Aave-3.2-features.md)
67+
68+
## Copyright
69+
70+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)