From 69061c6a01a6645558f69559b2a7804914ae79d5 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 5 Mar 2025 10:58:36 +0100 Subject: [PATCH 1/4] feat: add dust bin to deploy script --- src/contracts/misc/EmptyImplementation.sol | 10 ++++++++++ .../procedures/AaveV3TreasuryProcedure.sol | 15 +++++++++++++++ src/deployments/interfaces/IMarketReportTypes.sol | 2 ++ .../batches/AaveV3PeripheryBatch.sol | 3 +++ 4 files changed, 30 insertions(+) create mode 100644 src/contracts/misc/EmptyImplementation.sol diff --git a/src/contracts/misc/EmptyImplementation.sol b/src/contracts/misc/EmptyImplementation.sol new file mode 100644 index 00000000..b5768fb8 --- /dev/null +++ b/src/contracts/misc/EmptyImplementation.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** + * @notice This contract is an intentionally empty implementation. + * It's to be used for proxies that should be initialized with zero functionality. + */ +contract EmptyImplementation { + +} diff --git a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol index f4ffe2a9..64ed2b28 100644 --- a/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol +++ b/src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol @@ -3,12 +3,15 @@ pragma solidity ^0.8.0; import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol'; import {Collector} from '../../../contracts/treasury/Collector.sol'; +import {EmptyImplementation} from '../../../contracts/misc/EmptyImplementation.sol'; import '../../interfaces/IMarketReportTypes.sol'; contract AaveV3TreasuryProcedure { struct TreasuryReport { address treasuryImplementation; address treasury; + address emptyImplementation; + address dustBin; } function _deployAaveV3Treasury( @@ -29,6 +32,14 @@ contract AaveV3TreasuryProcedure { abi.encodeWithSelector(treasuryImplementation.initialize.selector, 100_000, poolAdmin) ) ); + treasuryReport.emptyImplementation = address(new EmptyImplementation{salt: salt}()); + treasuryReport.dustBin = address( + new TransparentUpgradeableProxy{salt: salt}( + treasuryReport.emptyImplementation, + poolAdmin, + '' + ) + ); } else { Collector treasuryImplementation = new Collector(); treasuryReport.treasuryImplementation = address(treasuryImplementation); @@ -40,6 +51,10 @@ contract AaveV3TreasuryProcedure { abi.encodeWithSelector(treasuryImplementation.initialize.selector, 100_000, poolAdmin) ) ); + treasuryReport.emptyImplementation = address(new EmptyImplementation()); + treasuryReport.dustBin = address( + new TransparentUpgradeableProxy(treasuryReport.emptyImplementation, poolAdmin, '') + ); } return treasuryReport; diff --git a/src/deployments/interfaces/IMarketReportTypes.sol b/src/deployments/interfaces/IMarketReportTypes.sol index 96bf5af7..99ecdfc4 100644 --- a/src/deployments/interfaces/IMarketReportTypes.sol +++ b/src/deployments/interfaces/IMarketReportTypes.sol @@ -173,6 +173,8 @@ struct PeripheryReport { address emissionManager; address rewardsControllerImplementation; address revenueSplitter; + address emptyImplementation; + address dustBin; } struct ParaswapReport { diff --git a/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol b/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol index af043379..b9a832a2 100644 --- a/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol +++ b/src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol @@ -30,6 +30,9 @@ contract AaveV3PeripheryBatch is _report.treasury = treasuryReport.treasury; _report.treasuryImplementation = treasuryReport.treasuryImplementation; + // bin and treasury are shared per network, so skipping based on treasury not being zero is fine + _report.dustBin = treasuryReport.dustBin; + _report.emptyImplementation = treasuryReport.emptyImplementation; } else { _report.treasury = config.treasury; } From 68b4639baff7a37cdb859254ab99eb238c0a6c0b Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 5 Mar 2025 11:00:34 +0100 Subject: [PATCH 2/4] fix: lint --- src/contracts/misc/EmptyImplementation.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/contracts/misc/EmptyImplementation.sol b/src/contracts/misc/EmptyImplementation.sol index b5768fb8..2ebc342c 100644 --- a/src/contracts/misc/EmptyImplementation.sol +++ b/src/contracts/misc/EmptyImplementation.sol @@ -5,6 +5,4 @@ pragma solidity ^0.8.0; * @notice This contract is an intentionally empty implementation. * It's to be used for proxies that should be initialized with zero functionality. */ -contract EmptyImplementation { - -} +contract EmptyImplementation {} From 83d273da2f0732018ae12e9472f83f190341f96e Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 5 Mar 2025 17:58:38 +0100 Subject: [PATCH 3/4] fix: add dustBin to report --- src/deployments/contracts/utilities/MetadataReporter.sol | 2 ++ src/deployments/interfaces/IMarketReportTypes.sol | 2 ++ .../projects/aave-v3-batched/AaveV3BatchOrchestration.sol | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/deployments/contracts/utilities/MetadataReporter.sol b/src/deployments/contracts/utilities/MetadataReporter.sol index f143aeae..fa0f89d6 100644 --- a/src/deployments/contracts/utilities/MetadataReporter.sol +++ b/src/deployments/contracts/utilities/MetadataReporter.sol @@ -38,11 +38,13 @@ contract MetadataReporter is IMetadataReporter { ); vm.serializeAddress(jsonReport, 'aaveOracle', report.aaveOracle); vm.serializeAddress(jsonReport, 'treasury', report.treasury); + vm.serializeAddress(jsonReport, 'dustBin', report.dustBin); vm.serializeAddress(jsonReport, 'wrappedTokenGateway', report.wrappedTokenGateway); vm.serializeAddress(jsonReport, 'walletBalanceProvider', report.walletBalanceProvider); vm.serializeAddress(jsonReport, 'uiIncentiveDataProvider', report.uiIncentiveDataProvider); vm.serializeAddress(jsonReport, 'uiPoolDataProvider', report.uiPoolDataProvider); vm.serializeAddress(jsonReport, 'treasuryImplementation', report.treasuryImplementation); + vm.serializeAddress(jsonReport, 'emptyImplementation', report.emptyImplementation); vm.serializeAddress(jsonReport, 'l2Encoder', report.l2Encoder); vm.serializeAddress(jsonReport, 'aToken', report.aToken); vm.serializeAddress(jsonReport, 'variableDebtToken', report.variableDebtToken); diff --git a/src/deployments/interfaces/IMarketReportTypes.sol b/src/deployments/interfaces/IMarketReportTypes.sol index 99ecdfc4..9f2d6b87 100644 --- a/src/deployments/interfaces/IMarketReportTypes.sol +++ b/src/deployments/interfaces/IMarketReportTypes.sol @@ -84,6 +84,8 @@ struct MarketReport { address staticATokenFactoryProxy; address staticATokenImplementation; address revenueSplitter; + address dustBin; + address emptyImplementation; } struct LibrariesReport { diff --git a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol index 1b213cb7..9e4d91b4 100644 --- a/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol +++ b/src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol @@ -314,6 +314,8 @@ library AaveV3BatchOrchestration { report.paraSwapWithdrawSwapAdapter = paraswapReport.paraSwapWithdrawSwapAdapter; report.treasuryImplementation = peripheryReport.treasuryImplementation; report.treasury = peripheryReport.treasury; + report.dustBin = peripheryReport.dustBin; + report.emptyImplementation = peripheryReport.emptyImplementation; report.poolProxy = setupReport.poolProxy; report.poolConfiguratorProxy = setupReport.poolConfiguratorProxy; report.rewardsControllerProxy = setupReport.rewardsControllerProxy; From 60337ab5dd91cfc3986f3118319b9f411af7b9a4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 7 Mar 2025 12:06:52 +0100 Subject: [PATCH 4/4] fix: add changeset --- .changeset/sixty-clubs-serve.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sixty-clubs-serve.md diff --git a/.changeset/sixty-clubs-serve.md b/.changeset/sixty-clubs-serve.md new file mode 100644 index 00000000..87b3a39c --- /dev/null +++ b/.changeset/sixty-clubs-serve.md @@ -0,0 +1,5 @@ +--- +"@aave-dao/aave-v3-origin": patch +--- + +In order to separate "dust", that is initially deposited on asset listing, from the treasury income a new "dustBin" contract was introduced. It does not hold any functionality, besides being upgradable by the DAO.