@@ -2,7 +2,7 @@ import dotenv from "dotenv";
22dotenv . config ( ) ;
33import hre from "hardhat" ;
44import { MaxUint256 , getBigInt , resolveAddress } from "ethers" ;
5- import { toBytes32 , getDeployXAddress } from "../test/helpers" ;
5+ import { toBytes32 } from "../test/helpers" ;
66import {
77 getVerifier , deployProxyX ,
88} from "./helpers" ;
@@ -84,8 +84,10 @@ export async function main() {
8484 }
8585
8686 let liquidityPool : LiquidityPool ;
87+ let mainPoolId : string ;
8788 if ( config . Aave ) {
8889 console . log ( "Deploying AAVE Liquidity Pool" ) ;
90+ mainPoolId = LiquidityPoolAaveUSDC ;
8991 liquidityPool = ( await verifier . deployX (
9092 "LiquidityPoolAave" ,
9193 deployer ,
@@ -98,12 +100,13 @@ export async function main() {
98100 minHealthFactor ,
99101 defaultLTV ,
100102 ] ,
101- LiquidityPoolAaveUSDC ,
103+ mainPoolId ,
102104 ) ) as LiquidityPool ;
103105 } else {
104106 console . log ( "Deploying USDC Liquidity Pool" ) ;
107+ mainPoolId = LiquidityPoolUSDC ;
105108 liquidityPool = ( await verifier . deployX (
106- "LiquidityPool" , deployer , { } , [ config . USDC , admin , mpcAddress ] , LiquidityPoolUSDC
109+ "LiquidityPool" , deployer , { } , [ config . USDC , admin , mpcAddress ] , mainPoolId
107110 ) ) as LiquidityPool ;
108111 }
109112
@@ -126,7 +129,6 @@ export async function main() {
126129
127130 const rebalancerVersion = config . IsTest ? "TestRebalancer" : "Rebalancer" ;
128131
129- const liquidityPoolAddress = await liquidityPool . getAddress ( ) ;
130132 config . Routes . Pools = await verifier . predictDeployXAddresses ( config . Routes ! . Pools ! , deployer ) ;
131133
132134 const { target : rebalancer , targetAdmin : rebalancerAdmin } = await deployProxyX < Rebalancer > (
@@ -212,10 +214,15 @@ export async function main() {
212214 if ( deployer . address !== admin ) {
213215 await liquidityPool . grantRole ( DEFAULT_ADMIN_ROLE , admin ) ;
214216 await liquidityPool . renounceRole ( DEFAULT_ADMIN_ROLE , deployer ) ;
217+
218+ if ( config . ExtraUSDCPool ) {
219+ await extraPool ! . grantRole ( DEFAULT_ADMIN_ROLE , admin ) ;
220+ await extraPool ! . renounceRole ( DEFAULT_ADMIN_ROLE , deployer ) ;
221+ }
215222 }
216223
217224 console . log ( `Admin: ${ admin } ` ) ;
218- console . log ( `LiquidityPool : ${ liquidityPool . target } ` ) ;
225+ console . log ( `${ mainPoolId } : ${ liquidityPool . target } ` ) ;
219226 console . log ( `LiquidityPool Withdraw Profit: ${ withdrawProfit } ` ) ;
220227 console . log ( `LiquidityPool Pauser: ${ pauser } ` ) ;
221228 console . log ( `USDC: ${ config . USDC } ` ) ;
0 commit comments