@@ -36,6 +36,8 @@ import {OFTAdapterUpgradeableDeployer, MintBurnOFTAdapterDeployer} from "./14_OF
3636import {EdgeFactoryDeployer} from "./15_EdgeFactory.s.sol " ;
3737import {EulerEarnImplementation, IntegrationsParams} from "./20_EulerEarnImplementation.s.sol " ;
3838import {EulerEarnFactory} from "./21_EulerEarnFactory.s.sol " ;
39+ import {EulerSwapImplementation} from "./22_EulerSwapImplementation.s.sol " ;
40+ import {EulerSwapFactory} from "./23_EulerSwapFactory.s.sol " ;
3941import {FactoryGovernor} from "./../src/Governor/FactoryGovernor.sol " ;
4042import {
4143 IGovernorAccessControlEmergencyFactory,
@@ -82,6 +84,10 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
8284 address uniswapV3Router;
8385 uint256 feeFlowInitPrice;
8486 bool deployOFT;
87+ bool deployEulerSwapV1;
88+ address uniswapPoolManager;
89+ address eulerSwapFeeOwner;
90+ address eulerSwapFeeRecipientSetter;
8591 }
8692
8793 struct AdaptiveCurveIRMParams {
@@ -172,7 +178,11 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
172178 uniswapV2Router: vm.parseJsonAddress (json, ".uniswapV2Router " ),
173179 uniswapV3Router: vm.parseJsonAddress (json, ".uniswapV3Router " ),
174180 feeFlowInitPrice: vm.parseJsonUint (json, ".feeFlowInitPrice " ),
175- deployOFT: vm.parseJsonBool (json, ".deployOFT " )
181+ deployOFT: vm.parseJsonBool (json, ".deployOFT " ),
182+ deployEulerSwapV1: vm.parseJsonBool (json, ".deployEulerSwapV1 " ),
183+ uniswapPoolManager: vm.parseJsonAddress (json, ".uniswapPoolManager " ),
184+ eulerSwapFeeOwner: vm.parseJsonAddress (json, ".eulerSwapFeeOwner " ),
185+ eulerSwapFeeRecipientSetter: vm.parseJsonAddress (json, ".eulerSwapFeeRecipientSetter " )
176186 });
177187
178188 if (
@@ -253,6 +263,7 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
253263 coreAddresses.eulerEarnFactory = deployer.deploy (coreAddresses.eulerEarnImplementation);
254264 } else {
255265 console.log ("- EulerEarn factory already deployed. Skipping... " );
266+ if (vm.isDir ("out-euler-earn " )) vm.removeDir ("out-euler-earn " , true );
256267 }
257268
258269 if (governorAddresses.eVaultFactoryGovernor == address (0 )) {
@@ -993,6 +1004,34 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
9931004 console.log ("- Adaptive Curve IRM factory or IRM registry not deployed. Skipping... " );
9941005 }
9951006
1007+ if (
1008+ eulerSwapAddresses.eulerSwapV1Implementation == address (0 )
1009+ && eulerSwapAddresses.eulerSwapV1Factory == address (0 )
1010+ ) {
1011+ if (input.deployEulerSwapV1) {
1012+ {
1013+ console.log ("+ Deploying EulerSwap V1 implementation... " );
1014+ EulerSwapImplementation deployer = new EulerSwapImplementation ();
1015+ eulerSwapAddresses.eulerSwapV1Implementation =
1016+ deployer.deploy (coreAddresses.evc, input.uniswapPoolManager);
1017+ }
1018+ {
1019+ console.log ("+ Deploying EulerSwap V1 factory... " );
1020+ EulerSwapFactory deployer = new EulerSwapFactory ();
1021+ eulerSwapAddresses.eulerSwapV1Factory = deployer.deploy (
1022+ coreAddresses.evc,
1023+ coreAddresses.eVaultFactory,
1024+ eulerSwapAddresses.eulerSwapV1Implementation,
1025+ input.eulerSwapFeeOwner,
1026+ input.eulerSwapFeeRecipientSetter
1027+ );
1028+ }
1029+ } else {
1030+ console.log ("- EulerSwap v1 not deployed. Skipping... " );
1031+ if (vm.isDir ("out-euler-swap " )) vm.removeDir ("out-euler-swap " , true );
1032+ }
1033+ }
1034+
9961035 executeBatch ();
9971036
9981037 if (multisendItemExists ()) {
@@ -1015,6 +1054,9 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
10151054 vm.writeJson (serializeGovernorAddresses (governorAddresses), getScriptFilePath ("GovernorAddresses_output.json " ));
10161055 vm.writeJson (serializeTokenAddresses (tokenAddresses), getScriptFilePath ("TokenAddresses_output.json " ));
10171056 vm.writeJson (serializeLensAddresses (lensAddresses), getScriptFilePath ("LensAddresses_output.json " ));
1057+ vm.writeJson (
1058+ serializeEulerSwapAddresses (eulerSwapAddresses), getScriptFilePath ("EulerSwapAddresses_output.json " )
1059+ );
10181060 vm.writeJson (serializeBridgeAddresses (bridgeAddresses), getScriptFilePath ("BridgeAddresses_output.json " ));
10191061 vm.writeJson (serializeBridgeConfigCache (), getScriptFilePath ("BridgeConfigCache_output.json " ));
10201062
@@ -1042,6 +1084,10 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
10421084 vm.writeJson (
10431085 serializeLensAddresses (lensAddresses), getAddressesFilePath ("LensAddresses.json " , block .chainid )
10441086 );
1087+ vm.writeJson (
1088+ serializeEulerSwapAddresses (eulerSwapAddresses),
1089+ getAddressesFilePath ("EulerSwapAddresses.json " , block .chainid )
1090+ );
10451091 vm.writeJson (
10461092 serializeBridgeAddresses (bridgeAddresses), getAddressesFilePath ("BridgeAddresses.json " , block .chainid )
10471093 );
0 commit comments