From fd83988473e59beae6820aa5cd97157432f51981 Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Thu, 16 Nov 2023 19:23:39 +0530 Subject: [PATCH 1/9] chore: add payload and deploy script for update of GHO variable debt token --- ...GHOVariableDebtTokenUpgrade_20231126.s.sol | 58 +++++++++++++++++++ ...m_GHOVariableDebtTokenUpgrade_20231126.sol | 32 ++++++++++ ...GHOVariableDebtTokenUpgrade_20231126.t.sol | 29 ++++++++++ 3 files changed, 119 insertions(+) create mode 100644 src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol create mode 100644 src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol create mode 100644 src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol new file mode 100644 index 000000000..38ae5d3ac --- /dev/null +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; + +/** + * @dev Deploy AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 + * command: make deploy-ledger contract=src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol:DeployEthereum chain=mainnet + */ +contract DeployEthereum is EthereumScript { + address constant NEW_VGHO_IMPL = 0x0000000000000000000000000000000000000000; + + function run() external broadcast { + // deploy payloads + AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 payload0 = new AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126( + NEW_VGHO_IMPL + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(address(payload0)); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + //TODO: Replace this address with payload address + actionsEthereum[0] = GovV3Helpers.buildAction(0xfb1163CD80850CD107bB134C15E5dfDF284F63FE); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal2_5( + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/' //TODO: Replace this with Summary file + ) + ); + } +} diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol new file mode 100644 index 000000000..1ad15671f --- /dev/null +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {ConfiguratorInputTypes} from 'aave-address-book/AaveV3.sol'; +import {IERC20} from 'forge-std/interfaces/IERC20.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; + +/** + * @title vGHO improvement: upgrade vGHO implementation + * @author AAVE + * - Discussion: + */ +contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 { + address public immutable NEW_VGHO_IMPL; + + constructor(address newVGhoImpl) { + NEW_VGHO_IMPL = newVGhoImpl; + } + + function execute() external { + AaveV3Ethereum.POOL_CONFIGURATOR.updateVariableDebtToken( + ConfiguratorInputTypes.UpdateDebtTokenInput({ + asset: AaveV3EthereumAssets.GHO_UNDERLYING, + incentivesController: AaveV3Ethereum.DEFAULT_INCENTIVES_CONTROLLER, + name: IERC20(AaveV3EthereumAssets.GHO_V_TOKEN).name(), + symbol: IERC20(AaveV3EthereumAssets.GHO_V_TOKEN).symbol(), + implementation: NEW_VGHO_IMPL, + params: bytes('') + }) + ); + } +} diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol new file mode 100644 index 000000000..e6cc1121a --- /dev/null +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; + +/** + * @dev Test for AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 + * command: make test-contract filter=AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 + */ +contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126_Test is ProtocolV3TestBase { + AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 internal proposal; + address constant NEW_VGHO_IMPL = address(0); + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 18584275); + proposal = new AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126(NEW_VGHO_IMPL); + } + + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126', + AaveV3Ethereum.POOL, + address(proposal) + ); + } +} From 0c8fcc0984e3510d08ab56d589dcd2460cca50c4 Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Thu, 16 Nov 2023 21:32:50 +0530 Subject: [PATCH 2/9] forge install: gho-core --- .gitmodules | 3 +++ lib/gho-core | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/gho-core diff --git a/.gitmodules b/.gitmodules index f7316a1d6..bf1f68fb0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "lib/aave-helpers"] path = lib/aave-helpers url = https://github.com/bgd-labs/aave-helpers +[submodule "lib/gho-core"] + path = lib/gho-core + url = https://github.com/aave/gho-core diff --git a/lib/gho-core b/lib/gho-core new file mode 160000 index 000000000..b2db7542f --- /dev/null +++ b/lib/gho-core @@ -0,0 +1 @@ +Subproject commit b2db7542f3a1323dcb3ca4823865909bd6677189 From 56dcb49e46f27cce456b6f9b880c6b5d5c0d333d Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Thu, 16 Nov 2023 23:00:40 +0530 Subject: [PATCH 3/9] chore: add gho-core to dependency --- remappings.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/remappings.txt b/remappings.txt index b3b219556..ec29a5471 100644 --- a/remappings.txt +++ b/remappings.txt @@ -7,3 +7,4 @@ aave-v3-periphery/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-periphery/ ds-test/=lib/aave-helpers/lib/forge-std/lib/ds-test/src/ forge-std/=lib/aave-helpers/lib/forge-std/src/ solidity-utils/=lib/aave-helpers/lib/solidity-utils/src/ +gho-core/=lib/gho-core/src/ \ No newline at end of file From ca92a11f6c9ee57a07d189cce810d225cc95fc27 Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Thu, 16 Nov 2023 23:01:12 +0530 Subject: [PATCH 4/9] test: Add tests for update of gho variable token --- ...AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol index e6cc1121a..c0a31b818 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol @@ -5,6 +5,7 @@ import 'forge-std/Test.sol'; import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; +import {GhoVariableDebtToken} from 'gho-core/contracts/facilitators/aave/tokens/GhoVariableDebtToken.sol'; /** * @dev Test for AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 @@ -26,4 +27,8 @@ contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126_Test is ProtocolV3T address(proposal) ); } + + function test_debtTokenRevisionUpdate() public { + assertTrue(GhoVariableDebtToken(AaveV3Ethereum.GHO_V_TOKEN).DEBT_TOKEN_REVISION == 0x3); + } } From 51adc07d01b4b4d00178c6a9e973e9098e6c0695 Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Fri, 17 Nov 2023 13:33:19 +0530 Subject: [PATCH 5/9] test: Add tests for update of gho variable token --- ...hereum_GHOVariableDebtTokenUpgrade_20231126.t.sol | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol index c0a31b818..6d96144a6 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol @@ -2,10 +2,14 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; -import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV3EthereumAssets, AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; -import {GhoVariableDebtToken} from 'gho-core/contracts/facilitators/aave/tokens/GhoVariableDebtToken.sol'; +import {IGhoVariableDebtToken} from 'gho-core/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol'; + +interface IGhoVariableDebtTokenHelper is IGhoVariableDebtToken { + function DEBT_TOKEN_REVISION() external returns (uint256); +} /** * @dev Test for AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 @@ -29,6 +33,8 @@ contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126_Test is ProtocolV3T } function test_debtTokenRevisionUpdate() public { - assertTrue(GhoVariableDebtToken(AaveV3Ethereum.GHO_V_TOKEN).DEBT_TOKEN_REVISION == 0x3); + assertTrue( + IGhoVariableDebtTokenHelper(AaveV3EthereumAssets.GHO_V_TOKEN).DEBT_TOKEN_REVISION() == 0x3 + ); } } From 0d77422baefe2b7b1b8451d3d2378ed6905cbc03 Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Fri, 17 Nov 2023 13:43:36 +0530 Subject: [PATCH 6/9] fix: add modifier in method of interface --- .../AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol index 6d96144a6..fd029be3b 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol @@ -8,7 +8,7 @@ import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ether import {IGhoVariableDebtToken} from 'gho-core/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol'; interface IGhoVariableDebtTokenHelper is IGhoVariableDebtToken { - function DEBT_TOKEN_REVISION() external returns (uint256); + function DEBT_TOKEN_REVISION() external view returns (uint256); } /** From 4bbc172be9e810c6cf3c4247acd70cef2401880a Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Fri, 17 Nov 2023 14:51:20 +0530 Subject: [PATCH 7/9] fix: remove gho dependency from repo and fix test --- .gitmodules | 3 --- remappings.txt | 3 +-- .../AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index bf1f68fb0..f7316a1d6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "lib/aave-helpers"] path = lib/aave-helpers url = https://github.com/bgd-labs/aave-helpers -[submodule "lib/gho-core"] - path = lib/gho-core - url = https://github.com/aave/gho-core diff --git a/remappings.txt b/remappings.txt index ec29a5471..620a76fc2 100644 --- a/remappings.txt +++ b/remappings.txt @@ -6,5 +6,4 @@ aave-v3-core/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-core/ aave-v3-periphery/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-periphery/ ds-test/=lib/aave-helpers/lib/forge-std/lib/ds-test/src/ forge-std/=lib/aave-helpers/lib/forge-std/src/ -solidity-utils/=lib/aave-helpers/lib/solidity-utils/src/ -gho-core/=lib/gho-core/src/ \ No newline at end of file +solidity-utils/=lib/aave-helpers/lib/solidity-utils/src/ \ No newline at end of file diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol index fd029be3b..a0bd151ca 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol +++ b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol @@ -5,9 +5,8 @@ import 'forge-std/Test.sol'; import {AaveV3EthereumAssets, AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; -import {IGhoVariableDebtToken} from 'gho-core/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol'; -interface IGhoVariableDebtTokenHelper is IGhoVariableDebtToken { +interface IGhoVariableDebtTokenHelper { function DEBT_TOKEN_REVISION() external view returns (uint256); } From e6ceca0837ee178754637fb514791a09c6014e7a Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Tue, 5 Dec 2023 12:16:23 +0100 Subject: [PATCH 8/9] fix: Remove unnecesary dependency --- lib/gho-core | 1 - 1 file changed, 1 deletion(-) delete mode 160000 lib/gho-core diff --git a/lib/gho-core b/lib/gho-core deleted file mode 160000 index b2db7542f..000000000 --- a/lib/gho-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b2db7542f3a1323dcb3ca4823865909bd6677189 From 335b8b972d83033bbd7ea8088811223e18bd0ad3 Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Tue, 5 Dec 2023 23:03:16 +0100 Subject: [PATCH 9/9] fix: Add latest details --- ...GHOVariableDebtTokenUpgrade_20231126.t.sol | 39 ---------------- ...veV3Ethereum_GhoIncidentReport_20231113.md | 28 ++++++++++++ ...Ethereum_GhoIncidentReport_20231113.s.sol} | 18 ++++---- ...V3Ethereum_GhoIncidentReport_20231113.sol} | 9 ++-- ...3Ethereum_GhoIncidentReport_20231113.t.sol | 44 +++++++++++++++++++ 5 files changed, 86 insertions(+), 52 deletions(-) delete mode 100644 src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol create mode 100644 src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.md rename src/{20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol => 20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol} (57%) rename src/{20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol => 20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.sol} (73%) create mode 100644 src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.t.sol diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol b/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol deleted file mode 100644 index a0bd151ca..000000000 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.t.sol +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import 'forge-std/Test.sol'; -import {AaveV3EthereumAssets, AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; -import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; -import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; - -interface IGhoVariableDebtTokenHelper { - function DEBT_TOKEN_REVISION() external view returns (uint256); -} - -/** - * @dev Test for AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 - * command: make test-contract filter=AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 - */ -contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126_Test is ProtocolV3TestBase { - AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 internal proposal; - address constant NEW_VGHO_IMPL = address(0); - - function setUp() public { - vm.createSelectFork(vm.rpcUrl('mainnet'), 18584275); - proposal = new AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126(NEW_VGHO_IMPL); - } - - function test_defaultProposalExecution() public { - defaultTest( - 'AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126', - AaveV3Ethereum.POOL, - address(proposal) - ); - } - - function test_debtTokenRevisionUpdate() public { - assertTrue( - IGhoVariableDebtTokenHelper(AaveV3EthereumAssets.GHO_V_TOKEN).DEBT_TOKEN_REVISION() == 0x3 - ); - } -} diff --git a/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.md b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.md new file mode 100644 index 000000000..98d6ad0c4 --- /dev/null +++ b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.md @@ -0,0 +1,28 @@ +--- +title: "GHO update on Aave V3 Ethereum Pool for 13/11/2023 Report" +author: "Aave Labs @aave" +discussions: "https://governance.aave.com/t/arfc-gho-technical-incident-13-11-2023/15642" +--- + +## Simple Summary + +This proposal patches the GHO integration with the Aave V3 Pool, fixing an issue reported by Immunefi on November 13, 2023. The patch, developed by Aave Labs in collaboration with Certora, upholds the highest safety standards. + +## Motivation + +A resolution for the identified technical issue identified in the GHO integration with the Aave V3 Ethereum Pool. The patch guarantees a permanent solution without altering any of the existing GHO features within the Aave Pool. + +## Specification + +The proposal payload upgrades the implementation of GhoVariableDebtToken. + +## References + +- GhoVariableDebtToken implementation: [GhoVariableDebtToken](https://etherscan.io/address/0x20cb2f303ede313e2cc44549ad8653a5e8c0050e#code) +- Implementation: [Payload]() +- [Discussion](https://governance.aave.com/t/arfc-gho-technical-incident-13-11-2023/15642) + + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol similarity index 57% rename from src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol rename to src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol index 38ae5d3ac..89ea31bb9 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol +++ b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol @@ -1,28 +1,27 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126} from './AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol'; -import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV3Ethereum_GhoIncidentReport_20231113} from './AaveV3Ethereum_GhoIncidentReport_20231113.sol'; import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; /** - * @dev Deploy AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 - * command: make deploy-ledger contract=src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol:DeployEthereum chain=mainnet + * @dev Deploy AaveV3Ethereum_GhoIncidentReport_20231113 + * command: make deploy-ledger contract=src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol:DeployEthereum chain=mainnet */ contract DeployEthereum is EthereumScript { - address constant NEW_VGHO_IMPL = 0x0000000000000000000000000000000000000000; + address constant NEW_VGHO_IMPL = 0x20Cb2f303EDe313e2Cc44549Ad8653a5E8c0050e; function run() external broadcast { // deploy payloads - AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 payload0 = new AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126( + AaveV3Ethereum_GhoIncidentReport_20231113 payload = new AaveV3Ethereum_GhoIncidentReport_20231113( NEW_VGHO_IMPL ); // compose action IPayloadsControllerCore.ExecutionAction[] memory actions = new IPayloadsControllerCore.ExecutionAction[](1); - actions[0] = GovV3Helpers.buildAction(address(payload0)); + actions[0] = GovV3Helpers.buildAction(address(payload)); // register action at payloadsController GovV3Helpers.createPayload(actions); @@ -31,7 +30,7 @@ contract DeployEthereum is EthereumScript { /** * @dev Create Proposal - * command: make deploy-ledger contract=src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.s.sol:CreateProposal chain=mainnet + * command: make deploy-ledger contract=src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.s.sol:CreateProposal chain=mainnet */ contract CreateProposal is EthereumScript { function run() external { @@ -48,10 +47,11 @@ contract CreateProposal is EthereumScript { // create proposal vm.startBroadcast(); GovV3Helpers.createProposal2_5( + vm, payloads, GovV3Helpers.ipfsHashFile( vm, - 'src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/' //TODO: Replace this with Summary file + 'src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.md' ) ); } diff --git a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.sol similarity index 73% rename from src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol rename to src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.sol index 1ad15671f..b80e50a1d 100644 --- a/src/20231126_AaveV3Ethereum_GHOVariableDebtTokenUpgrade/AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126.sol +++ b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.sol @@ -6,11 +6,12 @@ import {IERC20} from 'forge-std/interfaces/IERC20.sol'; import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; /** - * @title vGHO improvement: upgrade vGHO implementation - * @author AAVE - * - Discussion: + * @title GHO update on Aave V3 Ethereum Pool for 13/11/2023 Report + * @dev Upgrades the implementation of the GhoVariableDebtToken contract + * @author Aave Labs (@aave) + * - Discussion: https://governance.aave.com/t/arfc-gho-technical-incident-13-11-2023/15642 */ -contract AaveV3Ethereum_GHOVariableDebtTokenUpgrade_20231126 { +contract AaveV3Ethereum_GhoIncidentReport_20231113 { address public immutable NEW_VGHO_IMPL; constructor(address newVGhoImpl) { diff --git a/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.t.sol b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.t.sol new file mode 100644 index 000000000..344b71a41 --- /dev/null +++ b/src/20231207_AaveV3Ethereum_GhoIncidentReport_20231126/AaveV3Ethereum_GhoIncidentReport_20231113.t.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {AaveV3EthereumAssets, AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_GhoIncidentReport_20231113} from './AaveV3Ethereum_GhoIncidentReport_20231113.sol'; + +interface IGhoVariableDebtTokenHelper { + function DEBT_TOKEN_REVISION() external view returns (uint256); +} + +/** + * @dev Test for AaveV3Ethereum_GhoIncidentReport_20231113 + * command: make test-contract filter=AaveV3Ethereum_GhoIncidentReport_20231113 + */ +contract AaveV3Ethereum_GhoIncidentReport_20231113_Test is ProtocolV3TestBase { + address constant NEW_VGHO_IMPL = 0x20Cb2f303EDe313e2Cc44549Ad8653a5E8c0050e; + + AaveV3Ethereum_GhoIncidentReport_20231113 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 18722500); + proposal = new AaveV3Ethereum_GhoIncidentReport_20231113(NEW_VGHO_IMPL); + } + + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_GhoIncidentReport_20231113', + AaveV3Ethereum.POOL, + address(proposal) + ); + } + + function test_debtTokenRevisionUpdate() public { + assertTrue( + IGhoVariableDebtTokenHelper(AaveV3EthereumAssets.GHO_V_TOKEN).DEBT_TOKEN_REVISION() == 0x2 + ); + executePayload(vm, address(proposal)); + assertTrue( + IGhoVariableDebtTokenHelper(AaveV3EthereumAssets.GHO_V_TOKEN).DEBT_TOKEN_REVISION() == 0x3 + ); + } +}