Skip to content

Commit a0512f8

Browse files
authored
feat: adding dust bin to deployment script (#111)
1 parent bb6ea42 commit a0512f8

File tree

7 files changed

+39
-0
lines changed

7 files changed

+39
-0
lines changed

.changeset/sixty-clubs-serve.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aave-dao/aave-v3-origin": patch
3+
---
4+
5+
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
/**
5+
* @notice This contract is an intentionally empty implementation.
6+
* It's to be used for proxies that should be initialized with zero functionality.
7+
*/
8+
contract EmptyImplementation {}

src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol

+15
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ pragma solidity ^0.8.0;
33

44
import {TransparentUpgradeableProxy} from 'openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol';
55
import {Collector} from '../../../contracts/treasury/Collector.sol';
6+
import {EmptyImplementation} from '../../../contracts/misc/EmptyImplementation.sol';
67
import '../../interfaces/IMarketReportTypes.sol';
78

89
contract AaveV3TreasuryProcedure {
910
struct TreasuryReport {
1011
address treasuryImplementation;
1112
address treasury;
13+
address emptyImplementation;
14+
address dustBin;
1215
}
1316

1417
function _deployAaveV3Treasury(
@@ -29,6 +32,14 @@ contract AaveV3TreasuryProcedure {
2932
abi.encodeWithSelector(treasuryImplementation.initialize.selector, 100_000, poolAdmin)
3033
)
3134
);
35+
treasuryReport.emptyImplementation = address(new EmptyImplementation{salt: salt}());
36+
treasuryReport.dustBin = address(
37+
new TransparentUpgradeableProxy{salt: salt}(
38+
treasuryReport.emptyImplementation,
39+
poolAdmin,
40+
''
41+
)
42+
);
3243
} else {
3344
Collector treasuryImplementation = new Collector();
3445
treasuryReport.treasuryImplementation = address(treasuryImplementation);
@@ -40,6 +51,10 @@ contract AaveV3TreasuryProcedure {
4051
abi.encodeWithSelector(treasuryImplementation.initialize.selector, 100_000, poolAdmin)
4152
)
4253
);
54+
treasuryReport.emptyImplementation = address(new EmptyImplementation());
55+
treasuryReport.dustBin = address(
56+
new TransparentUpgradeableProxy(treasuryReport.emptyImplementation, poolAdmin, '')
57+
);
4358
}
4459

4560
return treasuryReport;

src/deployments/contracts/utilities/MetadataReporter.sol

+2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ contract MetadataReporter is IMetadataReporter {
3838
);
3939
vm.serializeAddress(jsonReport, 'aaveOracle', report.aaveOracle);
4040
vm.serializeAddress(jsonReport, 'treasury', report.treasury);
41+
vm.serializeAddress(jsonReport, 'dustBin', report.dustBin);
4142
vm.serializeAddress(jsonReport, 'wrappedTokenGateway', report.wrappedTokenGateway);
4243
vm.serializeAddress(jsonReport, 'walletBalanceProvider', report.walletBalanceProvider);
4344
vm.serializeAddress(jsonReport, 'uiIncentiveDataProvider', report.uiIncentiveDataProvider);
4445
vm.serializeAddress(jsonReport, 'uiPoolDataProvider', report.uiPoolDataProvider);
4546
vm.serializeAddress(jsonReport, 'treasuryImplementation', report.treasuryImplementation);
47+
vm.serializeAddress(jsonReport, 'emptyImplementation', report.emptyImplementation);
4648
vm.serializeAddress(jsonReport, 'l2Encoder', report.l2Encoder);
4749
vm.serializeAddress(jsonReport, 'aToken', report.aToken);
4850
vm.serializeAddress(jsonReport, 'variableDebtToken', report.variableDebtToken);

src/deployments/interfaces/IMarketReportTypes.sol

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ struct MarketReport {
8484
address staticATokenFactoryProxy;
8585
address staticATokenImplementation;
8686
address revenueSplitter;
87+
address dustBin;
88+
address emptyImplementation;
8789
}
8890

8991
struct LibrariesReport {
@@ -173,6 +175,8 @@ struct PeripheryReport {
173175
address emissionManager;
174176
address rewardsControllerImplementation;
175177
address revenueSplitter;
178+
address emptyImplementation;
179+
address dustBin;
176180
}
177181

178182
struct ParaswapReport {

src/deployments/projects/aave-v3-batched/AaveV3BatchOrchestration.sol

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ library AaveV3BatchOrchestration {
314314
report.paraSwapWithdrawSwapAdapter = paraswapReport.paraSwapWithdrawSwapAdapter;
315315
report.treasuryImplementation = peripheryReport.treasuryImplementation;
316316
report.treasury = peripheryReport.treasury;
317+
report.dustBin = peripheryReport.dustBin;
318+
report.emptyImplementation = peripheryReport.emptyImplementation;
317319
report.poolProxy = setupReport.poolProxy;
318320
report.poolConfiguratorProxy = setupReport.poolConfiguratorProxy;
319321
report.rewardsControllerProxy = setupReport.rewardsControllerProxy;

src/deployments/projects/aave-v3-batched/batches/AaveV3PeripheryBatch.sol

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ contract AaveV3PeripheryBatch is
3030

3131
_report.treasury = treasuryReport.treasury;
3232
_report.treasuryImplementation = treasuryReport.treasuryImplementation;
33+
// bin and treasury are shared per network, so skipping based on treasury not being zero is fine
34+
_report.dustBin = treasuryReport.dustBin;
35+
_report.emptyImplementation = treasuryReport.emptyImplementation;
3336
} else {
3437
_report.treasury = config.treasury;
3538
}

0 commit comments

Comments
 (0)