Skip to content

Commit 9c0871f

Browse files
sakulstraeboadomkyzia551
authored
feat: v3.6 upgrade (#923)
* feat: v3.6 upgrade * fix: stash changes * aip: add aip text * fix: split in two scripts * Change USDC reimbursement of Certora for GHO * Update src/20251209_Multi_UpgradeAaveInstancesToV36/UpgradeAaveInstancesToV362nd.md Co-authored-by: Andrey <[email protected]> --------- Co-authored-by: eboado <[email protected]> Co-authored-by: Andrey <[email protected]>
1 parent 9d89569 commit 9c0871f

File tree

9 files changed

+773
-0
lines changed

9 files changed

+773
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## Raw diff
2+
3+
```json
4+
{
5+
"raw": {
6+
"0x23878914efe38d27c4d67ab83ed1b93a74d4086a": {
7+
"label": "AaveV3Ethereum.ASSETS.USDT.A_TOKEN",
8+
"contract": "lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
9+
"balanceDiff": null,
10+
"nonceDiff": null,
11+
"stateDiff": {
12+
"0x14a553e31736f19e3e380cf55bfb2f82dfd6d880cd07235affb68d8d3e0cac4d": {
13+
"previousValue": "0x0000000003b8aef89cc7c0dabdb6271c00000000000000000000082b866d4079",
14+
"newValue": "0x0000000003b8b197a01f79441b710fc600000000000000000000081487887a84"
15+
},
16+
"0xf57a0f05777e493f6eb3a9303c3f677c25a62ed0fdbf9d58a277df4680f70afb": {
17+
"previousValue": "0x0000000003b66881510165be08b9632c00000000000000000000000149e53516",
18+
"newValue": "0x0000000003b8b197a01f79441b710fc600000000000000000000001848c9fb0b"
19+
}
20+
}
21+
},
22+
"0x40d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f": {
23+
"label": "AaveV3Ethereum.ASSETS.GHO.UNDERLYING, AaveV3EthereumHorizon.ASSETS.GHO.UNDERLYING, AaveV3EthereumLido.ASSETS.GHO.UNDERLYING, GhoEthereum.GHO_TOKEN, UmbrellaEthereum.UMBRELLA_STAKE_ASSETS.STK_GHO_V1.UNDERLYING",
24+
"contract": null,
25+
"balanceDiff": null,
26+
"nonceDiff": null,
27+
"stateDiff": {
28+
"0x1523217c4b07de374edaab82dd137508368abb580fb66aedbf032086a67e1f8f": {
29+
"previousValue": "0x0000000000000000000000000000000000000000000000001d75462dcc513f13",
30+
"newValue": "0x0000000000000000000000000000000000000000000006701a351c136f513f13"
31+
},
32+
"0x3107e6fb53c93683833e8824cc59e9c9f27821bf7d710a977a825c1959995195": {
33+
"previousValue": "0x00000000000000000000000000000000000000000001fa37cc57983e78a07dc4",
34+
"newValue": "0x00000000000000000000000000000000000000000001f3c7cf97c258d5a07dc4"
35+
}
36+
}
37+
},
38+
"0xdabad81af85554e9ae636395611c58f7ec1aaec5": {
39+
"label": "GovernanceV3Ethereum.PAYLOADS_CONTROLLER",
40+
"contract": "lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
41+
"balanceDiff": null,
42+
"nonceDiff": null,
43+
"stateDiff": {
44+
"0x9f77e4f63f470e3320849240e1f97ff5165a9bf5349321bf5a55674b74146a4e": {
45+
"previousValue": "0x0069577726000000000002000000000000000000000000000000000000000000",
46+
"newValue": "0x0069577726000000000003000000000000000000000000000000000000000000"
47+
},
48+
"0x9f77e4f63f470e3320849240e1f97ff5165a9bf5349321bf5a55674b74146a4f": {
49+
"previousValue": "0x000000000000000000093a8000000000000069859ba700000000000000000000",
50+
"newValue": "0x000000000000000000093a8000000000000069859ba700000000000069577727"
51+
}
52+
}
53+
}
54+
}
55+
}
56+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.10;
3+
4+
library Deployments {
5+
address public constant BASE = address(0x3D7a80B4c666FB285ca49f145F8467FaA80dB301); // cancun
6+
address public constant GNOSIS = address(0x073264F6F30f8a50189E144967B7f22a6D22003f); // cancun
7+
address public constant POLYGON = address(0x4e4BaA9cbD2FF6281F5bA050810F061A4E6e0850); // cancun
8+
address public constant ARBITRUM = address(0xb8FD4Fe11aa830EEC7f73FD5435366052665Eda5); // cancun
9+
address public constant OPTIMISM = address(0x2957a5b8b4A5fC6Cf9Fe5b2D79B66a18871abb20); // cancun
10+
address public constant AVALANCHE = address(0xF045F5E209Bc758a85aE75f5e2e79fDC50fD499f); // cancun
11+
address public constant SONIC = address(0x1306a50626B475ae21dB7210356BdDE1EAA2781a); // cancun
12+
address public constant METIS = address(0x1B72B5799B455bAf19Af89495B5d35C155956587); //shanghai
13+
address public constant BNB = address(0x4a61666015eC3bf05b9CC7754F8A475833d160dF); // cancun
14+
address public constant CELO = address(0x0A2b39388E7B716da882DcDAB6080F57f9a8B9a1); // cancun
15+
address public constant SCROLL = address(0x0a4C8f5740c9e21d64484Ccfcd85a2FeaDC004d5); // cancun
16+
address public constant LINEA = address(0xef45332E99700297e813F0E236E14a48A4CfAC99); // cancun
17+
address public constant ZKSYNC = address(0xA485DE0D7D43B2b47731ae436daa1de32033fC12); // cancun
18+
address public constant SONEIUM = address(0x7ada3b2963342ce5417f31f82e0eFfa8E1494350); // cancun
19+
address public constant INK = address(0x386547279911303Cb6Dc9443477C46bDa96c280C); // cancun
20+
address public constant PLASMA = address(0x23cEfa65515274C5832F1D4F789E1d27b301e1E6); // cancun
21+
address public constant MAINNET_CORE = address(0xaCAeFE6Cf2ef667fA8Be03AaeDe402CBcD6ed44D); // cancun
22+
address public constant MAINNET_LIDO = address(0x95D6cDe855d58DEA260e1A8297E299176FC11b6f); // cancun
23+
address public constant MAINNET_ETHERFI = address(0x46738047c72952953b14e9801648EF05F056EA2C); // cancun
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
5+
import {IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/IERC20.sol';
6+
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
7+
8+
/**
9+
* @title Reimbursement for v3.6 audits
10+
* @author BGD Labs @bgdlabs
11+
* - Discussion: https://governance.aave.com/t/arfc-bgd-aave-v3-6/23172
12+
*/
13+
contract ReimbursePayload is IProposalGenericExecutor {
14+
address public constant CERTORA = 0x0F11640BF66e2D9352d9c41434A5C6E597c5e4c8;
15+
address public constant BGD = 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF;
16+
17+
function execute() external override {
18+
AaveV3Ethereum.COLLECTOR.transfer(IERC20(AaveV3EthereumAssets.USDT_A_TOKEN), BGD, 113_752e6);
19+
20+
AaveV3Ethereum.COLLECTOR.transfer(
21+
IERC20(AaveV3EthereumAssets.GHO_UNDERLYING),
22+
CERTORA,
23+
30_400e18
24+
);
25+
}
26+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
5+
import {UmbrellaEthereum} from 'aave-address-book/UmbrellaEthereum.sol';
6+
import {IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/IERC20.sol';
7+
8+
import 'forge-std/Test.sol';
9+
import {ProtocolV3TestBase} from 'aave-helpers/src/ProtocolV3TestBase.sol';
10+
import {ReimbursePayload} from './ReimbursePayload.sol';
11+
12+
/**
13+
* @dev Test for ReimbursePayload
14+
* command:
15+
* FOUNDRY_PROFILE=test forge test \
16+
* --match-path=src/20251209_Multi_UpgradeAaveInstancesToV36/ReimbursePayload.t.sol \
17+
* -vv
18+
*/
19+
contract ReimbursePayload_Test is ProtocolV3TestBase {
20+
ReimbursePayload internal proposal;
21+
22+
function setUp() public {
23+
vm.createSelectFork(vm.rpcUrl('mainnet'), 24145530);
24+
proposal = new ReimbursePayload();
25+
}
26+
27+
/**
28+
* @dev executes the generic test suite including e2e and config snapshots
29+
*/
30+
function test_defaultProposalExecution() public {
31+
defaultTest('ReimbursePayload', AaveV3Ethereum.POOL, address(proposal));
32+
}
33+
34+
function test_balanceBeforeAfter() public {
35+
uint256 ghoBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(proposal.CERTORA());
36+
uint256 usdtBefore = IERC20(AaveV3EthereumAssets.USDT_A_TOKEN).balanceOf(proposal.BGD());
37+
38+
executePayload(vm, address(proposal));
39+
40+
uint256 ghoAfter = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(proposal.CERTORA());
41+
uint256 usdtAfter = IERC20(AaveV3EthereumAssets.USDT_A_TOKEN).balanceOf(proposal.BGD());
42+
43+
assertEq(ghoAfter - ghoBefore, 30_400e18, 'GHO post-proposal balance mismatch');
44+
assertApproxEqAbs(usdtAfter - usdtBefore, 113_752e6, 2);
45+
}
46+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "Upgrade Aave instances to v3.6 Part 1"
3+
author: "BGD Labs @bgdlabs"
4+
discussions: "https://governance.aave.com/t/arfc-bgd-aave-v3-6/23172/4"
5+
snapshot: "https://snapshot.box/#/s:aavedao.eth/proposal/0x83ab94cea13da68fc9685dc2fa8ad738107bdbebd01fdf04122131d5de1d7847"
6+
---
7+
8+
## Simple Summary
9+
10+
Upgrade the Aave protocol instances from v3.5 to v3.6 Part 1.
11+
12+
## Motivation
13+
14+
Aave v3.6 enhances isolation, via more fine-grained configurations and the decoupling of eMode and eMode0 settings. For a comprehensive overview of the changes, please refer to the [documentation](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/docs/3.6/Aave-v3.6-features.md).
15+
16+
## Specification
17+
18+
The upgrade payload updates the implementations of the Pool, PoolConfigurator, AToken & VariableDebtToken on an initial set of pools, namely **Sonic, Optimism, Gnosis, Scroll, ZKSync, Celo, Metis, Soneium, and Ethereum (EtherFi)**.
19+
20+
An additional action is included on mainnet which:
21+
22+
- transfers 113'752 $ as aUSDT to a BGD Labs address
23+
- transfers 30'400 $ as GHO to a Certora address
24+
25+
to reimburse the cost of the audits.
26+
27+
## Security procedures
28+
29+
The upgrade was extensively unit tested and fuzzed.
30+
Certora adapted its formal properties to ensure the upgrade's correctness.
31+
In addition 5 audits by Independent Auditors were conducted.
32+
33+
- [Blackthorn](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-16_Blackthorn_Aave-v3.6.pdf)
34+
- [Certora](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_Certora_Aave-v3.6.pdf)
35+
- [MixBytes](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_MixBytes_Aave-v3.6.pdf)
36+
- [Savant](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_Savant_Aave-v3.6.pdf)
37+
- [Pashov](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-29_Pashov_Aave-v3.6.pdf)
38+
39+
## References
40+
41+
- Implementation: [All Networks](https://github.com/bgd-labs/protocol-v3.6-upgrade/blob/main/src/UpgradePayload.sol)
42+
- [Tests](https://github.com/bgd-labs/protocol-v3.6-upgrade/tree/main/test)
43+
- [Diffs](https://github.com/bgd-labs/protocol-v3.6-upgrade/tree/main/diffs/code)
44+
- [Snapshot](https://snapshot.box/#/s:aavedao.eth/proposal/0x83ab94cea13da68fc9685dc2fa8ad738107bdbebd01fdf04122131d5de1d7847)
45+
- [Discussion](https://governance.aave.com/t/arfc-bgd-aave-v3-6/23172)
46+
47+
## Copyright
48+
49+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "Upgrade Aave instances to v3.6 Part 2"
3+
author: "BGD Labs @bgdlabs"
4+
discussions: "https://governance.aave.com/t/arfc-bgd-aave-v3-6/23172/4"
5+
snapshot: "https://snapshot.box/#/s:aavedao.eth/proposal/0x83ab94cea13da68fc9685dc2fa8ad738107bdbebd01fdf04122131d5de1d7847"
6+
---
7+
8+
## Simple Summary
9+
10+
Upgrade the Aave protocol instances from v3.5 to v3.6 **Part 2**.
11+
12+
## Motivation
13+
14+
Aave v3.6 enhances isolation, via more fine-grained configurations and the decoupling of eMode and eMode0 settings. For a comprehensive overview of the changes, please refer to the [documentation](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/docs/3.6/Aave-v3.6-features.md).
15+
16+
## Specification
17+
18+
The upgrade payload updates the implementations of the Pool, PoolConfigurator, AToken & VariableDebtToken on the second set of pools, namely **Mainnet(Core), Mainnet(Prime), Plasma, Base, Arbitrum, Avalanche, Linea, BNB Chain, Polygon**.
19+
20+
On **mainnet core** the payloads varies slightly to account for:
21+
22+
- aAave which has a different implementation due to the governance delegation integration
23+
- vGHO which has a different implementation due to the deprecated discount mechanism on stkAAVE
24+
25+
## Security procedures
26+
27+
The upgrade was extensively unit tested and fuzzed.
28+
Certora adapted its formal properties to ensure the upgrade's correctness.
29+
In addition 5 audits by Independent Auditors were conducted.
30+
31+
- [Blackthorn](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-16_Blackthorn_Aave-v3.6.pdf)
32+
- [Certora](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_Certora_Aave-v3.6.pdf)
33+
- [MixBytes](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_MixBytes_Aave-v3.6.pdf)
34+
- [Savant](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-18_Savant_Aave-v3.6.pdf)
35+
- [Pashov](https://github.com/bgd-labs/aave-v3-origin/blob/b3ce63440cacd4054c62d55c6282afd248215b28/audits/2025-11-29_Pashov_Aave-v3.6.pdf)
36+
37+
## References
38+
39+
- Implementation: [AaveV3EthereumMainnetCore](https://github.com/bgd-labs/protocol-v3.6-upgrade/blob/main/src/UpgradePayloadMainnetCore.sol), [Other Networks](https://github.com/bgd-labs/protocol-v3.6-upgrade/blob/main/src/UpgradePayload.sol)
40+
- [Tests](https://github.com/bgd-labs/protocol-v3.6-upgrade/tree/main/test)
41+
- [Diffs](https://github.com/bgd-labs/protocol-v3.6-upgrade/tree/main/diffs/code)
42+
- [Snapshot](https://snapshot.box/#/s:aavedao.eth/proposal/0x83ab94cea13da68fc9685dc2fa8ad738107bdbebd01fdf04122131d5de1d7847)
43+
- [Discussion](https://governance.aave.com/t/arfc-bgd-aave-v3-6/23172)
44+
45+
## Copyright
46+
47+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)