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

V3.3 upgrade proposal #1

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# env zksync
FOUNDRY_LIBRARIES=aave-v3-origin/contracts/protocol/libraries/logic/BorrowLogic.sol:BorrowLogic:0xc3Ba0a556e0813BBf0741CdaD6086ca1023cd6d3,aave-v3-origin/contracts/protocol/libraries/logic/BridgeLogic.sol:BridgeLogic:0x345a778167524995d6788a9a0e1d0eeb7cbfe496,aave-v3-origin/contracts/protocol/libraries/logic/ConfiguratorLogic.sol:ConfiguratorLogic:0xeFAC7Bb7f7943Df27EfC108EbAfc450e3812acda,aave-v3-origin/contracts/protocol/libraries/logic/EModeLogic.sol:EModeLogic:0xA2C266Cd25296A7174134B0a6d894e250c830504,aave-v3-origin/contracts/protocol/libraries/logic/FlashLoanLogic.sol:FlashLoanLogic:0xcE53459E8734Df93399A425183Ee1860Ca8c2D0b,aave-v3-origin/contracts/protocol/libraries/logic/LiquidationLogic.sol:LiquidationLogic:0x0c0191dd96ed7ef86d1cc319eb68f127c196a6ee,aave-v3-origin/contracts/protocol/libraries/logic/PoolLogic.sol:PoolLogic:0xd60e89f5b8bd0e46029fd127741da136b3a574d7,aave-v3-origin/contracts/protocol/libraries/logic/SupplyLogic.sol:SupplyLogic:0x20ea931ce718b5f3bcdcfc3b7d2685f6a853a55d
# FOUNDRY_LIBRARIES=

# evn others
FOUNDRY_LIBRARIES=aave-v3-origin/contracts/protocol/libraries/logic/BorrowLogic.sol:BorrowLogic:0x4c52FE2162200bf26c314d7bbd8611699139d553,aave-v3-origin/contracts/protocol/libraries/logic/BridgeLogic.sol:BridgeLogic:0x97dCbFaE5372A63128F141E8C0BC2c871Ca5F604,aave-v3-origin/contracts/protocol/libraries/logic/ConfiguratorLogic.sol:ConfiguratorLogic:0x3a593A622754ed9572599D33Aad6D799B0899Fae,aave-v3-origin/contracts/protocol/libraries/logic/EModeLogic.sol:EModeLogic:0x88F864670De467aA73CD45325F9652C578C8AB85,aave-v3-origin/contracts/protocol/libraries/logic/FlashLoanLogic.sol:FlashLoanLogic:0xb32381feFFF45eE9F47fD2f2cF83C832637d6EF0,aave-v3-origin/contracts/protocol/libraries/logic/LiquidationLogic.sol:LiquidationLogic:0x80d16970B31243Fe67DaB028115f3E4c3E3510Ad,aave-v3-origin/contracts/protocol/libraries/logic/PoolLogic.sol:PoolLogic:0xA58FB47bE9074828215A173564C0CD10f6F249bf,aave-v3-origin/contracts/protocol/libraries/logic/SupplyLogic.sol:SupplyLogic:0x2b22E425C1322fbA0DbF17bb1dA25d71811EE7ba
# env others
# FOUNDRY_LIBRARIES=
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
[submodule "lib/aave-helpers"]
path = lib/aave-helpers
url = https://github.com/bgd-labs/aave-helpers
branch = feat/3.2.0
[submodule "lib/aave-v3-origin"]
path = lib/aave-v3-origin
url = https://github.com/bgd-labs/aave-v3-origin
branch = feat/mock-stable-debt
branch = v3.3.0
38 changes: 16 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aave v3.2 upgrade
# Aave v3.3 upgrade

This repository contains contracts to upgrade existing instances of Aave protocol from v3.1.0 to v3.2.0.
This repository contains contracts to upgrade existing instances of Aave protocol from v3.2.0 to v3.3.0.

<br>

Expand All @@ -25,24 +25,6 @@ Command run test for all networks expect zkSync: `forge test`

Command to run test for zkSync: `FOUNDRY_PROFILE=zksync forge test --zksync`


<br>

## Specification

### [PoolInstance3_2](./src/contracts/PoolInstance.sol)

Extends `PoolInstance` contract, and includes custom initialization for the stable debt off-boarding.

The logic of the custom initialization is:
```
currentReserve.__deprecatedStableDebtTokenAddress = address(0);
```

This makes sure that the `__deprecatedStableDebtTokenAddress` points to `address(0)` and also the `__deprecatedStableBorrowRate` is `0`

For L2s instances, an additional [L2PoolInstance3_2](./src/contracts/L2PoolInstance.sol) is included, introducing the `L2PoolInstance` contract in the inheritance chain.

<br>

### Upgrade payload
Expand All @@ -52,11 +34,23 @@ The payload for the upgrade does the following:
- Upgrades the `PoolConfigurator` implementation.
- Upgrades the `Pool` implementation.
- Connects the new `PoolDataProvider` to the `PoolAddressesProvider`.
- Deploys new InterestRateStrategy contract and updates interest rates from the previous strategy contract and sets them on the new one.
- Migrates all assets currently in eMode to be both borrowable & collateral in eMode

<br>

### Misc

Additionally their are new versions of some periphery-contracts that might be deployed alongside the proposal, namely:

- `WrappedTokenGatewayV3`
- `ParaswapAdapters`
- `StataTokenFactory`

It's important to note that these contracts are:

- not part of the upgrade payload.
- they don't need to be upgraded, the old versions are perfectly operational.

Using the newer versions will result in slightly lower gas usage on certain operations.

## License

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0x8a48EF9287c402C119c14a5f6897F6dFdc12cb45",
"to": "0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770"
"from": "0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770",
"to": "0xd8AfB86b075911804807ADD739D4aA2Cad9698D6"
},
"protocolDataProvider": {
"from": "0x57038C3e3Fe0a170BB72DE2fD56E98e4d1a69717",
"to": "0x14f3E6a037b323B63e578578B9A3db89FD4f7311"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xC89fBD2a15e88A72A76428DA00dDBBE47cb4EBB0",
"to": "0xcA311Dce5b11436c7Bd7b3847E77adE29F829F8e"
"from": "0xcA311Dce5b11436c7Bd7b3847E77adE29F829F8e",
"to": "0x0245b4c2634DB660790605dDAD2A06aA5d4F7e14"
},
"protocolDataProvider": {
"from": "0xC01372469A17b6716A38F00c277533917B6859c0",
"to": "0x560cfa0184972cb5794C1E342dB4E7dD602D3138"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xb7F64c31f1c9c2c0a4b1a7fDA9Ce0Aed487DF9F4",
"to": "0x7A7eF57479123f26DB6a0e3EFbF8A3562EDD65BE"
"from": "0x7A7eF57479123f26DB6a0e3EFbF8A3562EDD65BE",
"to": "0xF92039F547d39496Cc517C7d35d95886B6FE3459"
},
"protocolDataProvider": {
"from": "0x7F23D86Ee20D869112572136221e173428DD740B",
"to": "0xd659a075fAd11182124a33Db2C304a60Caeae208"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0x1f69d4700B34A1D9F92E55235df414FcC02A8306",
"to": "0x5DFb8c777C19d3cEdcDc7398d2EeF1FB0b9b05c9"
"from": "0x5DFb8c777C19d3cEdcDc7398d2EeF1FB0b9b05c9",
"to": "0xCE82E6A474AE11AD783Ea19B17141d6BD134Cfd3"
},
"protocolDataProvider": {
"from": "0x7F23D86Ee20D869112572136221e173428DD740B",
"to": "0xd659a075fAd11182124a33Db2C304a60Caeae208"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0x54b63fa80D6D657Bc77a5fbE56EA6bFAfB6E5A5d",
"to": "0x3d881c2Dc90F00e7A52F06155f77FBEC63A779c7"
"from": "0x3d881c2Dc90F00e7A52F06155f77FBEC63A779c7",
"to": "0x5388dE2dA90Cb4Eeb98396B65436b094fea8fb42"
},
"protocolDataProvider": {
"from": "0xE7d490885A68f00d9886508DF281D67263ed5758",
"to": "0x7C8b4F342ee2FB434d884b7EBe45DB348e50e279"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xF96e23D32584536552C70D99664D4B17F373229c",
"to": "0xf5b4664CB6D13189345119c60a948cdc7785d0FE"
"from": "0xf5b4664CB6D13189345119c60a948cdc7785d0FE",
"to": "0xecca943b8f56c900658834b3E6044635F562e7Ac"
},
"protocolDataProvider": {
"from": "0x08795CFE08C7a81dCDFf482BbAAF474B240f31cD",
"to": "0x14A9664Fcb52428736973772D0babdC5D28315fF"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0x1f64488c2C4686771dafA75915274d27878B667a",
"to": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd"
"from": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd",
"to": "0x41AbF6bD79CDD28bFAa38313c6FA3A05FB0079B6"
},
"protocolDataProvider": {
"from": "0x41393e5e337606dc3821075Af65AeE84D7688CBD",
"to": "0x2501E60da6C5ADF125f9A8ED691Ad4e63cf7ab29"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xb7F64c31f1c9c2c0a4b1a7fDA9Ce0Aed487DF9F4",
"to": "0x7A7eF57479123f26DB6a0e3EFbF8A3562EDD65BE"
"from": "0x7A7eF57479123f26DB6a0e3EFbF8A3562EDD65BE",
"to": "0xF92039F547d39496Cc517C7d35d95886B6FE3459"
},
"protocolDataProvider": {
"from": "0x7F23D86Ee20D869112572136221e173428DD740B",
"to": "0xd659a075fAd11182124a33Db2C304a60Caeae208"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0x1f69d4700B34A1D9F92E55235df414FcC02A8306",
"to": "0x5DFb8c777C19d3cEdcDc7398d2EeF1FB0b9b05c9"
"from": "0x5DFb8c777C19d3cEdcDc7398d2EeF1FB0b9b05c9",
"to": "0xCE82E6A474AE11AD783Ea19B17141d6BD134Cfd3"
},
"protocolDataProvider": {
"from": "0x7F23D86Ee20D869112572136221e173428DD740B",
"to": "0xd659a075fAd11182124a33Db2C304a60Caeae208"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xE8Ba6eD06F0c00885754704108a72A54a5E5b764",
"to": "0xcB2107Ace932591C57EB5D07A135F1F3Dd613Dc0"
"from": "0xcB2107Ace932591C57EB5D07A135F1F3Dd613Dc0",
"to": "0x791a578315001aA75dF036793d5b55622c5090B3"
},
"protocolDataProvider": {
"from": "0xe2108b60623C6Dcf7bBd535bD15a451fd0811f7b",
"to": "0x0c9c244128cA88A972027DB062ea1Fc8AECC43b3"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xE498675A3dd5aB2Cab72986dc7AA9B2AE87Acec4",
"to": "0xB769c2A9259B3Eedaf120d8643C4C7EAe977fd7f"
"from": "0xB769c2A9259B3Eedaf120d8643C4C7EAe977fd7f",
"to": "0x1F6cb7E15CF12273B87bD749B1c53A1F3eeFD22A"
},
"protocolDataProvider": {
"from": "0x23dF2a19384231aFD114b036C14b6b03324D79BC",
"to": "0x6923044CBB91E98CCAe5155B1a2783e85C06a40a"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## Emodes changes

## Raw diff

```json
{
"poolConfig": {
"poolConfiguratorImpl": {
"from": "0x4816b2C2895f97fB918f1aE7Da403750a0eE372e",
"to": "0x750aD0c1C18065A5b982835b378C91a2C12BA98E"
},
"poolImpl": {
"from": "0xDea262629b7D28722Ad4189c515f93c996D2Cd72",
"to": "0x3a9C471F13C9cA1eBDf440cf713C8404e498F9C3"
"from": "0x3a9C471F13C9cA1eBDf440cf713C8404e498F9C3",
"to": "0x8428d29aC97b1851091543efb2b8af4Bd4Ffe9c8"
},
"protocolDataProvider": {
"from": "0xd82a47fdebB5bf5329b09441C3DaB4b5df2153Ad",
"to": "0xA611876F14734c13624DA4B19e59D9697c5B5b73"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/aave-v3-origin
Submodule aave-v3-origin updated 127 files
2 changes: 1 addition & 1 deletion lib/forge-std
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"prettier-plugin-solidity": "1.1.3"
},
"dependencies": {
"@bgd-labs/aave-cli": "1.1.2"
"@bgd-labs/aave-cli": "^1.1.12"
}
}
Loading