@@ -84,6 +84,7 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
8484 address uniswapV3Router;
8585 uint256 feeFlowInitPrice;
8686 bool deployOFT;
87+ bool deployEulerEarn;
8788 bool deployEulerSwapV1;
8889 address uniswapPoolManager;
8990 address eulerSwapFeeOwner;
@@ -171,6 +172,7 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
171172 uniswapV3Router: vm.parseJsonAddress (json, ".uniswapV3Router " ),
172173 feeFlowInitPrice: vm.parseJsonUint (json, ".feeFlowInitPrice " ),
173174 deployOFT: vm.parseJsonBool (json, ".deployOFT " ),
175+ deployEulerEarn: vm.parseJsonBool (json, ".deployEulerEarn " ),
174176 deployEulerSwapV1: vm.parseJsonBool (json, ".deployEulerSwapV1 " ),
175177 uniswapPoolManager: vm.parseJsonAddress (json, ".uniswapPoolManager " ),
176178 eulerSwapFeeOwner: vm.parseJsonAddress (json, ".eulerSwapFeeOwner " ),
@@ -680,13 +682,15 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
680682 console.log ("- At least one of the Periphery factories contracts already deployed. Skipping... " );
681683 }
682684
683- if (peripheryAddresses.feeFlowController == address (0 )) {
685+ if (
686+ peripheryAddresses.feeFlowController == address (0 ) && peripheryAddresses.feeFlowControllerUtil == address (0 )
687+ ) {
684688 address paymentToken = bridgeAddresses.oftAdapter == address (0 ) ? getWETHAddress () : tokenAddresses.EUL;
685689
686690 if (input.feeFlowInitPrice != 0 && paymentToken != address (0 )) {
687- console.log ("+ Deploying FeeFlow ... " );
691+ console.log ("+ Deploying FeeFlowController and FeeFlowControllerUtil ... " );
688692 FeeFlow deployer = new FeeFlow ();
689- peripheryAddresses.feeFlowController = deployer.deploy (
693+ ( peripheryAddresses.feeFlowController, peripheryAddresses.feeFlowControllerUtil) = deployer.deploy (
690694 coreAddresses.evc,
691695 input.feeFlowInitPrice,
692696 paymentToken,
@@ -696,7 +700,9 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
696700 FEE_FLOW_MIN_INIT_PRICE
697701 );
698702 } else {
699- console.log ("! feeFlowInitPrice or paymentToken is not set for FeeFlow deployment. Skipping... " );
703+ console.log (
704+ "! feeFlowInitPrice or paymentToken is not set for FeeFlowController and FeeFlowControllerUtil deployment. Skipping... "
705+ );
700706 }
701707
702708 address feeReceiver = peripheryAddresses.feeFlowController == address (0 )
@@ -857,10 +863,15 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
857863 }
858864
859865 if (coreAddresses.eulerEarnFactory == address (0 ) && peripheryAddresses.eulerEarnPublicAllocator == address (0 )) {
860- console.log ("+ Deploying EulerEarn factory and public allocator... " );
861- EulerEarnFactoryDeployer deployer = new EulerEarnFactoryDeployer ();
862- (coreAddresses.eulerEarnFactory, peripheryAddresses.eulerEarnPublicAllocator) =
863- deployer.deploy (coreAddresses.evc, coreAddresses.permit2, peripheryAddresses.evkFactoryPerspective);
866+ if (input.deployEulerEarn) {
867+ console.log ("+ Deploying EulerEarn factory and public allocator... " );
868+ EulerEarnFactoryDeployer deployer = new EulerEarnFactoryDeployer ();
869+ (coreAddresses.eulerEarnFactory, peripheryAddresses.eulerEarnPublicAllocator) =
870+ deployer.deploy (coreAddresses.evc, coreAddresses.permit2, peripheryAddresses.evkFactoryPerspective);
871+ } else {
872+ console.log ("- EulerEarn not deployed. Skipping... " );
873+ if (vm.isDir ("out-euler-earn " )) vm.removeDir ("out-euler-earn " , true );
874+ }
864875 } else {
865876 console.log ("- EulerEarn factory and public allocator already deployed. Skipping... " );
866877 if (vm.isDir ("out-euler-earn " )) vm.removeDir ("out-euler-earn " , true );
@@ -870,11 +881,15 @@ contract CoreAndPeriphery is BatchBuilder, SafeMultisendBuilder {
870881 peripheryAddresses.eulerEarnFactoryPerspective == address (0 )
871882 && peripheryAddresses.eulerEarnGovernedPerspective == address (0 )
872883 ) {
873- console.log ("+ Deploying EulerEarnFactoryPerspective and Euler Earn GovernedPerspective... " );
874- EulerEarnPerspectivesDeployer deployer = new EulerEarnPerspectivesDeployer ();
875- address [] memory perspectives = deployer.deploy (coreAddresses.eulerEarnFactory);
876- peripheryAddresses.eulerEarnFactoryPerspective = perspectives[0 ];
877- peripheryAddresses.eulerEarnGovernedPerspective = perspectives[1 ];
884+ if (input.deployEulerEarn) {
885+ console.log ("+ Deploying EulerEarnFactoryPerspective and Euler Earn GovernedPerspective... " );
886+ EulerEarnPerspectivesDeployer deployer = new EulerEarnPerspectivesDeployer ();
887+ address [] memory perspectives = deployer.deploy (coreAddresses.eulerEarnFactory);
888+ peripheryAddresses.eulerEarnFactoryPerspective = perspectives[0 ];
889+ peripheryAddresses.eulerEarnGovernedPerspective = perspectives[1 ];
890+ } else {
891+ console.log ("- EulerEarn perspectives not deployed. Skipping... " );
892+ }
878893 } else {
879894 console.log ("- At least one of the Euler Earn perspectives is already deployed. Skipping... " );
880895 }
0 commit comments