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

feat: add dust bin to deploy script #111

Merged
merged 5 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions src/contracts/misc/EmptyImplementation.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// 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 {}
15 changes: 15 additions & 0 deletions src/deployments/contracts/procedures/AaveV3TreasuryProcedure.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/deployments/interfaces/IMarketReportTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ struct PeripheryReport {
address emissionManager;
address rewardsControllerImplementation;
address revenueSplitter;
address emptyImplementation;
address dustBin;
}

struct ParaswapReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down