@@ -12,11 +12,11 @@ import {
1212import {
1313 TestUSDC , SprinterUSDCLPShare , LiquidityHub ,
1414 SprinterLiquidityMining , TestCCTPTokenMessenger , TestCCTPMessageTransmitter ,
15- Rebalancer , Repayer , LiquidityPool , LiquidityPoolAave ,
15+ Rebalancer , Repayer , LiquidityPool , LiquidityPoolAave , LiquidityPoolStablecoin
1616} from "../typechain-types" ;
1717import {
1818 networkConfig , Network , Provider , NetworkConfig , LiquidityPoolUSDC ,
19- LiquidityPoolAaveUSDC ,
19+ LiquidityPoolAaveUSDC , LiquidityPoolUSDCStablecoin
2020} from "../network.config" ;
2121
2222export async function main ( ) {
@@ -95,18 +95,21 @@ export async function main() {
9595 Providers : [ Provider . CCTP ] ,
9696 SupportsAllTokens : [ false ] ,
9797 } ,
98- USDCPool : true
98+ USDCPool : true ,
99+ USDCStablecoinPool : true ,
99100 } ;
100101 }
101102
102- assert ( config . AavePool !== undefined || config . USDCPool ! , "At least one pool should be present." ) ;
103+ assert ( config . AavePool ! || config . USDCPool ! || config . USDCStablecoinPool ! ,
104+ "At least one pool should be present." ) ;
103105 assert ( isAddress ( config . USDC ) , "USDC must be an address" ) ;
104106 assert ( isAddress ( config . Admin ) , "Admin must be an address" ) ;
105107 assert ( isAddress ( config . WithdrawProfit ) , "WithdrawProfit must be an address" ) ;
106108 assert ( isAddress ( config . Pauser ) , "Pauser must be an address" ) ;
107109 assert ( isAddress ( config . RebalanceCaller ) , "RebalanceCaller must be an address" ) ;
108110 assert ( isAddress ( config . RepayerCaller ) , "RepayerCaller must be an address" ) ;
109111 assert ( isAddress ( config . MpcAddress ) , "MpcAddress must be an address" ) ;
112+
110113 if ( config . Hub ) {
111114 assert ( config . Hub ! . Tiers . length > 0 , "Empty liquidity mining tiers configuration." ) ;
112115 assert ( config . Hub ! . AssetsLimit <= MaxUint256 / 10n ** 12n , "Assets limit is too high" ) ;
@@ -189,6 +192,28 @@ export async function main() {
189192 }
190193 }
191194
195+ let usdcStablecoinPool : LiquidityPoolStablecoin ;
196+ if ( config . USDCStablecoinPool ) {
197+ console . log ( "Deploying USDC Stablecoin Liquidity Pool" ) ;
198+ usdcStablecoinPool = ( await verifier . deployX (
199+ "LiquidityPoolStablecoin" , deployer , { } , [ config . USDC , deployer , config . MpcAddress ] , LiquidityPoolUSDCStablecoin
200+ ) ) as LiquidityPool ;
201+ console . log ( `LiquidityPoolUSDCStablecoin: ${ usdcStablecoinPool . target } ` ) ;
202+
203+ config . RebalancerRoutes . Pools . push ( await usdcStablecoinPool . getAddress ( ) ) ;
204+ config . RebalancerRoutes . Domains . push ( network ) ;
205+ config . RebalancerRoutes . Providers . push ( Provider . LOCAL ) ;
206+
207+ config . RepayerRoutes . Pools . push ( await usdcStablecoinPool . getAddress ( ) ) ;
208+ config . RepayerRoutes . Domains . push ( network ) ;
209+ config . RepayerRoutes . Providers . push ( Provider . LOCAL ) ;
210+ config . RepayerRoutes . SupportsAllTokens . push ( false ) ;
211+
212+ if ( ( ! config . AavePool ) && ( ! config . USDCPool ) ) {
213+ mainPool = usdcStablecoinPool ;
214+ }
215+ }
216+
192217 const rebalancerVersion = config . IsTest ? "TestRebalancer" : "Rebalancer" ;
193218
194219 config . RebalancerRoutes . Pools = await verifier . predictDeployXAddresses ( config . RebalancerRoutes ! . Pools ! , deployer ) ;
@@ -221,6 +246,12 @@ export async function main() {
221246 await usdcPool ! . grantRole ( PAUSER_ROLE , config . Pauser ) ;
222247 }
223248
249+ if ( config . USDCStablecoinPool ) {
250+ await usdcStablecoinPool ! . grantRole ( LIQUIDITY_ADMIN_ROLE , rebalancer ) ;
251+ await usdcStablecoinPool ! . grantRole ( WITHDRAW_PROFIT_ROLE , config . WithdrawProfit ) ;
252+ await usdcStablecoinPool ! . grantRole ( PAUSER_ROLE , config . Pauser ) ;
253+ }
254+
224255 const repayerVersion = config . IsTest ? "TestRepayer" : "Repayer" ;
225256
226257 config . RepayerRoutes . Pools = await verifier . predictDeployXAddresses ( config . RepayerRoutes ! . Pools ! , deployer ) ;
@@ -304,6 +335,11 @@ export async function main() {
304335 await usdcPool ! . grantRole ( DEFAULT_ADMIN_ROLE , config . Admin ) ;
305336 await usdcPool ! . renounceRole ( DEFAULT_ADMIN_ROLE , deployer ) ;
306337 }
338+
339+ if ( config . USDCStablecoinPool ) {
340+ await usdcStablecoinPool ! . grantRole ( DEFAULT_ADMIN_ROLE , config . Admin ) ;
341+ await usdcStablecoinPool ! . renounceRole ( DEFAULT_ADMIN_ROLE , deployer ) ;
342+ }
307343 }
308344
309345 let multicall : string ;
0 commit comments