Skip to content

Commit

Permalink
Refactor factory
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed Jul 23, 2024
1 parent c3fd0d1 commit 6af81ca
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions src/core/EulerAggregationVaultFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
/// @custom:security-contact [email protected]
/// @author Euler Labs (https://www.eulerlabs.com/)
contract EulerAggregationVaultFactory {
error WithdrawalQueueAlreadyWhitelisted();
error NotWhitelistedWithdrawalQueueImpl();
error InvalidQuery();

/// core dependencies
Expand All @@ -23,7 +21,7 @@ contract EulerAggregationVaultFactory {
address public immutable strategyModule;
address public immutable rebalanceModule;
/// aggregation vault implementation address
// address public immutable aggregationVaultImpl;
address public immutable aggregationVaultImpl;

address[] public aggregationVaults;

Expand Down Expand Up @@ -52,15 +50,15 @@ contract EulerAggregationVaultFactory {
strategyModule = Clones.clone(_factoryParams.strategyModuleImpl);
rebalanceModule = Clones.clone(_factoryParams.rebalanceModuleImpl);

// IEulerAggregationVault.ConstructorParams memory aggregationVaultConstructorParams = IEulerAggregationVault
// .ConstructorParams({
// rewardsModule: rewardsModule,
// hooksModule: hooksModule,
// feeModule: feeModule,
// strategyModule: strategyModule,
// rebalanceModule: rebalanceModule
// });
// aggregationVaultImpl = address(new EulerAggregationVault(aggregationVaultConstructorParams));
IEulerAggregationVault.ConstructorParams memory aggregationVaultConstructorParams = IEulerAggregationVault
.ConstructorParams({
rewardsModule: rewardsModule,
hooksModule: hooksModule,
feeModule: feeModule,
strategyModule: strategyModule,
rebalanceModule: rebalanceModule
});
aggregationVaultImpl = address(new EulerAggregationVault(aggregationVaultConstructorParams));
}

/// @notice Deploy a new aggregation vault.
Expand All @@ -79,16 +77,7 @@ contract EulerAggregationVaultFactory {
string memory _symbol,
uint256 _initialCashAllocationPoints
) external returns (address) {
// address eulerAggregationVault = Clones.clone(aggregationVaultImpl);
IEulerAggregationVault.ConstructorParams memory aggregationVaultConstructorParams = IEulerAggregationVault
.ConstructorParams({
rewardsModule: rewardsModule,
hooksModule: hooksModule,
feeModule: feeModule,
strategyModule: strategyModule,
rebalanceModule: rebalanceModule
});
address eulerAggregationVault = address(new EulerAggregationVault(aggregationVaultConstructorParams));
address eulerAggregationVault = Clones.clone(aggregationVaultImpl);

IEulerAggregationVault.InitParams memory aggregationVaultInitParams = IEulerAggregationVault.InitParams({
aggregationVaultOwner: msg.sender,
Expand Down

0 comments on commit 6af81ca

Please sign in to comment.