diff --git a/deployments/deployments.staging.yml b/deployments/deployments.staging.yml index 8bf8cdf..04a566b 100644 --- a/deployments/deployments.staging.yml +++ b/deployments/deployments.staging.yml @@ -2,8 +2,8 @@ eip155:8453: deployment id: MVP env: stage name: BASE - LiquidityPoolAaveUSDC: "0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D" - LiquidityPoolUSDC: "0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0" + LiquidityPoolAaveUSDC: "0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683" + LiquidityPoolUSDC: "0x578aD20ec27E11B3772F91cc6f435d782cc362EA" SprinterUSDCLPShare: "0xCb85b9fEFcA1316EFe0B7E1965A8922701fF502f" LiquidityHub: "0x6FD4142Be84134C5a6D45d454529A6C3c9573B61" SprinterLiquidityMining: "0xa85Aa9ac9EaC15BA8636cE4C8014135bC34B0525" @@ -17,8 +17,8 @@ eip155:10: deployment id: MVP env: stage name: OP_MAINNET - LiquidityPoolAaveUSDC: "0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D" - LiquidityPoolUSDC: "0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0" + LiquidityPoolAaveUSDC: "0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683" + LiquidityPoolUSDC: "0x578aD20ec27E11B3772F91cc6f435d782cc362EA" CensoredTransferFromMulticall: "0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3" USDC: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" Rebalancer: "0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9" @@ -29,9 +29,9 @@ eip155:42161: deployment id: MVP env: stage name: ARBITRUM_ONE - LiquidityPoolAaveUSDC: "0x2D24c6c58bBCe4BC09aE6ac559F697D97665d05D" - LiquidityPoolUSDC: "0xfe22Dff2Dc00E80e3127BCac393aC4e0672570F0" - LiquidityPoolAaveUSDCLongTerm: "0xd1A7cC673D4cE966AD31FcD8Daccf1C2B5969dA4" + LiquidityPoolAaveUSDC: "0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683" + LiquidityPoolUSDC: "0x578aD20ec27E11B3772F91cc6f435d782cc362EA" + LiquidityPoolAaveUSDCLongTerm: "0x4ce56b5D7e79dF121aF2eC055D096eF983F459e6" CensoredTransferFromMulticall: "0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3" USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" Rebalancer: "0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9" diff --git a/deployments/redeploy-usdcpool-arbitrumone-stage.log b/deployments/redeploy-usdcpool-arbitrumone-stage.log new file mode 100644 index 0000000..15d57cc --- /dev/null +++ b/deployments/redeploy-usdcpool-arbitrumone-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying USDC Pool +Using config for: stage, ARBITRUM_ONE +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying USDC Liquidity Pool +LiquidityPoolUSDC-V3-e09cc75: 0x578aD20ec27E11B3772F91cc6f435d782cc362EA diff --git a/deployments/redeploy-usdcpool-base-stage.log b/deployments/redeploy-usdcpool-base-stage.log new file mode 100644 index 0000000..b044acc --- /dev/null +++ b/deployments/redeploy-usdcpool-base-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying USDC Pool +Using config for: stage, BASE +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying USDC Liquidity Pool +LiquidityPoolUSDC-V3-e09cc75: 0x578aD20ec27E11B3772F91cc6f435d782cc362EA diff --git a/deployments/redeploy-usdcpool-opmainnet-stage.log b/deployments/redeploy-usdcpool-opmainnet-stage.log new file mode 100644 index 0000000..7a4987a --- /dev/null +++ b/deployments/redeploy-usdcpool-opmainnet-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying USDC Pool +Using config for: stage, OP_MAINNET +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying USDC Liquidity Pool +LiquidityPoolUSDC-V3-e09cc75: 0x578aD20ec27E11B3772F91cc6f435d782cc362EA diff --git a/deployments/redeploy-usdcpoolaave-arbitrumone-stage.log b/deployments/redeploy-usdcpoolaave-arbitrumone-stage.log new file mode 100644 index 0000000..7a8e7fc --- /dev/null +++ b/deployments/redeploy-usdcpoolaave-arbitrumone-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying Aave USDC Pool +Using config for: stage, ARBITRUM_ONE +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying Aave USDC Liquidity Pool +LiquidityPoolAaveUSDC-V3-e09cc75: 0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683 diff --git a/deployments/redeploy-usdcpoolaave-base-stage.log b/deployments/redeploy-usdcpoolaave-base-stage.log new file mode 100644 index 0000000..a61e4d0 --- /dev/null +++ b/deployments/redeploy-usdcpoolaave-base-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying Aave USDC Pool +Using config for: stage, BASE +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying Aave USDC Liquidity Pool +LiquidityPoolAaveUSDC-V3-e09cc75: 0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683 diff --git a/deployments/redeploy-usdcpoolaave-opmainnet-stage.log b/deployments/redeploy-usdcpoolaave-opmainnet-stage.log new file mode 100644 index 0000000..88a0025 --- /dev/null +++ b/deployments/redeploy-usdcpoolaave-opmainnet-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying Aave USDC Pool +Using config for: stage, OP_MAINNET +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying Aave USDC Liquidity Pool +LiquidityPoolAaveUSDC-V3-e09cc75: 0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683 diff --git a/deployments/redeploy-usdcpoolaavelongterm-arbitrumone-stage.log b/deployments/redeploy-usdcpoolaavelongterm-arbitrumone-stage.log new file mode 100644 index 0000000..f64329c --- /dev/null +++ b/deployments/redeploy-usdcpoolaavelongterm-arbitrumone-stage.log @@ -0,0 +1,6 @@ +Deployment ID: MVP +Deploying Aave USDC Long Term Pool +Using config for: stage, ARBITRUM_ONE +Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9 +Deploying Aave USDC Long Term Liquidity Pool +LiquidityPoolAaveUSDCLongTerm-V2-e09cc75: 0x4ce56b5D7e79dF121aF2eC055D096eF983F459e6 diff --git a/deployments/upgrade-liquidityhub-base-stage.log b/deployments/upgrade-liquidityhub-base-stage.log new file mode 100644 index 0000000..02dd730 --- /dev/null +++ b/deployments/upgrade-liquidityhub-base-stage.log @@ -0,0 +1,12 @@ +Deployment ID: MVP +Upgrade ID: MVP2 +Upgrading Liquidity Hub +Using config for: stage, BASE +Liquidity Pool: 0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683 +New LiquidityHub implementation deployed to 0xB7b59D39041aD311d4d46B90A85e3b4F5faD3E9D +Simulating LiquidityHub upgrade. +Success. +To finalize upgrade send the following transaction from ProxyAdmin owner: 0x2D5B6C193C39D2AECb4a99052074E6F325258a0f +To: 0x806BA52Fad6BED2EE431e4a3CC436B3F3Da54aED +Value: 0 +Data: 0x9623609d0000000000000000000000006fd4142be84134c5a6d45d454529a6c3c9573b61000000000000000000000000b7b59d39041ad311d4d46b90a85e3b4f5fad3e9d00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000 diff --git a/network.config.ts b/network.config.ts index 78883e9..28fff8b 100644 --- a/network.config.ts +++ b/network.config.ts @@ -4,36 +4,36 @@ import * as AAVEPools from "@bgd-labs/aave-address-book"; // Subsequent implementation just use UPGRADE_ID env variable. // Immutable contracts are deployed first with the name-derived unique id. // Subsequent versions use version suffix plus a git commit from the main branch. -export const LiquidityPoolAaveUSDC: string = "LiquidityPoolAaveUSDC"; -export const LiquidityPoolUSDC: string = "LiquidityPoolUSDC"; -export const LiquidityPoolUSDCStablecoin: string = "LiquidityPoolUSDCStablecoin"; -export const LiquidityPoolAaveUSDCLongTerm: string = "LiquidityPoolAaveUSDCLongTerm"; -export const LiquidityPoolAaveUSDCLongTermV2: string = "LiquidityPoolAaveUSDCLongTerm-V2-8ec44b8"; -export const LiquidityPoolAaveUSDCV2: string = "LiquidityPoolAaveUSDC-V2-3601cc4"; -export const LiquidityPoolUSDCV2: string = "LiquidityPoolUSDC-V2-3601cc4"; -export const LiquidityPoolUSDCStablecoinV2: string = "LiquidityPoolUSDCStablecoin-V2-3601cc4"; -export const LiquidityPoolAaveUSDCV3: string = "LiquidityPoolAaveUSDC-V3-8ec44b8"; -export const LiquidityPoolUSDCV3: string = "LiquidityPoolUSDC-V3-8ec44b8"; -export const LiquidityPoolUSDCStablecoinV3: string = "LiquidityPoolUSDCStablecoin-V3-8ec44b8"; -export const LiquidityPoolAaveUSDCLongTermVersions: string[] = [ +export const LiquidityPoolAaveUSDC = "LiquidityPoolAaveUSDC"; +export const LiquidityPoolUSDC = "LiquidityPoolUSDC"; +export const LiquidityPoolUSDCStablecoin = "LiquidityPoolUSDCStablecoin"; +export const LiquidityPoolAaveUSDCLongTerm = "LiquidityPoolAaveUSDCLongTerm"; +export const LiquidityPoolAaveUSDCLongTermV2 = "LiquidityPoolAaveUSDCLongTerm-V2-e09cc75"; +export const LiquidityPoolAaveUSDCV2 = "LiquidityPoolAaveUSDC-V2-3601cc4"; +export const LiquidityPoolUSDCV2 = "LiquidityPoolUSDC-V2-3601cc4"; +export const LiquidityPoolUSDCStablecoinV2 = "LiquidityPoolUSDCStablecoin-V2-3601cc4"; +export const LiquidityPoolAaveUSDCV3 = "LiquidityPoolAaveUSDC-V3-e09cc75"; +export const LiquidityPoolUSDCV3 = "LiquidityPoolUSDC-V3-e09cc75"; +export const LiquidityPoolUSDCStablecoinV3 = "LiquidityPoolUSDCStablecoin-V3-e09cc75"; +export const LiquidityPoolAaveUSDCLongTermVersions = [ LiquidityPoolAaveUSDCLongTerm, LiquidityPoolAaveUSDCLongTermV2, -]; -export const LiquidityPoolAaveUSDCVersions: string[] = [ +] as const; +export const LiquidityPoolAaveUSDCVersions = [ LiquidityPoolAaveUSDC, LiquidityPoolAaveUSDCV2, LiquidityPoolAaveUSDCV3, -]; -export const LiquidityPoolUSDCVersions: string[] = [ +] as const; +export const LiquidityPoolUSDCVersions = [ LiquidityPoolUSDC, LiquidityPoolUSDCV2, LiquidityPoolUSDCV3, -]; -export const LiquidityPoolUSDCStablecoinVersions: string[] = [ +] as const; +export const LiquidityPoolUSDCStablecoinVersions = [ LiquidityPoolUSDCStablecoin, LiquidityPoolUSDCStablecoinV2, LiquidityPoolUSDCStablecoinV3, -]; +] as const; export enum Network { ETHEREUM = "ETHEREUM", @@ -112,6 +112,10 @@ interface HubConfig { AssetsLimitSetter: string; // Address that can set assets limit. AssetsLimit: number; // Deposits to Liquidity Hub are only allowed till this limit is reached. Tiers: Tier[]; + Pool?: (typeof LiquidityPoolUSDCVersions)[number] + | (typeof LiquidityPoolAaveUSDCVersions)[number] + | (typeof LiquidityPoolUSDCStablecoinVersions)[number] + | (typeof LiquidityPoolAaveUSDCLongTermVersions)[number]; }; export interface NetworkConfig { @@ -384,34 +388,34 @@ export const networkConfig: NetworksConfig = { MpcAddress: "0x6adAF8c96151962198a9b73132c16E99F4682Eb5", SignerAddress: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f", RebalancerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { [Network.BASE]: [Provider.CCTP], [Network.ARBITRUM_ONE]: [Provider.CCTP], }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { [Network.BASE]: [Provider.CCTP], [Network.ARBITRUM_ONE]: [Provider.CCTP], }, - [LiquidityPoolAaveUSDCLongTerm]: { + [LiquidityPoolAaveUSDCLongTermV2]: { [Network.ARBITRUM_ONE]: [Provider.CCTP], }, }, RepayerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { SupportsAllTokens: true, Domains: { [Network.ARBITRUM_ONE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], [Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], }, }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { SupportsAllTokens: false, Domains: { [Network.ARBITRUM_ONE]: [Provider.CCTP], [Network.BASE]: [Provider.CCTP], }, }, - [LiquidityPoolAaveUSDCLongTerm]: { + [LiquidityPoolAaveUSDCLongTermV2]: { SupportsAllTokens: true, Domains: { [Network.ARBITRUM_ONE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], @@ -421,7 +425,7 @@ export const networkConfig: NetworksConfig = { AavePool: { AaveAddressesProvider: AAVEPools.AaveV3Optimism.POOL_ADDRESSES_PROVIDER, MinHealthFactor: 300, - DefaultLTV: 0, + DefaultLTV: 50, TokenLTVs: { "0x1f32b1c2345538c0c6f582fcb022739c4a194ebb": 50, // wstETH "0x4200000000000000000000000000000000000006": 50, // WETH @@ -549,24 +553,24 @@ export const networkConfig: NetworksConfig = { MpcAddress: "0x6adAF8c96151962198a9b73132c16E99F4682Eb5", SignerAddress: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f", RebalancerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { [Network.BASE]: [Provider.CCTP], [Network.OP_MAINNET]: [Provider.CCTP], }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { [Network.BASE]: [Provider.CCTP], [Network.OP_MAINNET]: [Provider.CCTP], }, }, RepayerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { SupportsAllTokens: true, Domains: { [Network.OP_MAINNET]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], [Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], }, }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { SupportsAllTokens: false, Domains: { [Network.OP_MAINNET]: [Provider.CCTP], @@ -577,7 +581,7 @@ export const networkConfig: NetworksConfig = { AavePool: { AaveAddressesProvider: AAVEPools.AaveV3Arbitrum.POOL_ADDRESSES_PROVIDER, MinHealthFactor: 300, - DefaultLTV: 0, + DefaultLTV: 50, TokenLTVs: { "0xaf88d065e77c8cc2239327c5edb3a432268e5831": 100, // USDC "0x82af49447d8a07e3bd95bd0d56f35241523fbab1": 50, // WETH @@ -731,37 +735,38 @@ export const networkConfig: NetworksConfig = { {period: 7776000n, multiplier: 400000000n}, {period: 15552000n, multiplier: 1000000000n}, {period: 31104000n, multiplier: 2200000000n}, - ] + ], + Pool: LiquidityPoolAaveUSDCV3, }, RebalancerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { [Network.OP_MAINNET]: [Provider.CCTP], [Network.ARBITRUM_ONE]: [Provider.CCTP], }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { [Network.OP_MAINNET]: [Provider.CCTP], [Network.ARBITRUM_ONE]: [Provider.CCTP], }, - [LiquidityPoolAaveUSDCLongTerm]: { + [LiquidityPoolAaveUSDCLongTermV2]: { [Network.ARBITRUM_ONE]: [Provider.CCTP], }, }, RepayerRoutes: { - [LiquidityPoolAaveUSDC]: { + [LiquidityPoolAaveUSDCV3]: { SupportsAllTokens: true, Domains: { [Network.OP_MAINNET]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], [Network.ARBITRUM_ONE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], }, }, - [LiquidityPoolUSDC]: { + [LiquidityPoolUSDCV3]: { SupportsAllTokens: false, Domains: { [Network.OP_MAINNET]: [Provider.CCTP], [Network.ARBITRUM_ONE]: [Provider.CCTP], }, }, - [LiquidityPoolAaveUSDCLongTerm]: { + [LiquidityPoolAaveUSDCLongTermV2]: { SupportsAllTokens: true, Domains: { [Network.ARBITRUM_ONE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR], @@ -771,7 +776,7 @@ export const networkConfig: NetworksConfig = { AavePool: { AaveAddressesProvider: AAVEPools.AaveV3Base.POOL_ADDRESSES_PROVIDER, MinHealthFactor: 300, - DefaultLTV: 0, + DefaultLTV: 50, TokenLTVs: { "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913": 100, // USDC "0x4200000000000000000000000000000000000006": 50, // WETH diff --git a/package.json b/package.json index 438a615..8eb707a 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,13 @@ "deploy-usdcpoolaavelongterm-ethereum": "hardhat run ./scripts/deployUSDCPoolAaveLongTerm.ts --network ETHEREUM", "deploy-usdcpool-ethereum": "hardhat run ./scripts/deployUSDCPool.ts --network ETHEREUM", "deploy-usdcpool-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPool.ts --network BASE", + "deploy-usdcpoolaave-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPoolAave.ts --network BASE", "deploy-usdcstablecoinpool-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCStablecoinPool.ts --network BASE", + "deploy-usdcpool-arbitrumone-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPool.ts --network ARBITRUM_ONE", + "deploy-usdcpoolaave-arbitrumone-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPoolAave.ts --network ARBITRUM_ONE", "deploy-usdcpoolaavelongterm-arbitrumone-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPoolAaveLongTerm.ts --network ARBITRUM_ONE", + "deploy-usdcpool-opmainnet-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPool.ts --network OP_MAINNET", + "deploy-usdcpoolaave-opmainnet-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/deployUSDCPoolAave.ts --network OP_MAINNET", "deploy-repayer-base": "hardhat run ./scripts/deployRepayer.ts --network BASE", "deploy-repayer-arbitrumone": "hardhat run ./scripts/deployRepayer.ts --network ARBITRUM_ONE", "deploy-repayer-opmainnet": "hardhat run ./scripts/deployRepayer.ts --network OP_MAINNET", @@ -44,6 +49,7 @@ "deploy-spark-stage-repayer-opmainnet": "STANDALONE_REPAYER_ENV=SparkStage hardhat run ./scripts/deployStandaloneRepayer.ts --network OP_MAINNET", "upgrade-liquidityhub-basesepolia": "hardhat run ./scripts/upgradeLiquidityHub.ts --network BASE_SEPOLIA", "upgrade-liquidityhub-base": "hardhat run ./scripts/upgradeLiquidityHub.ts --network BASE", + "upgrade-liquidityhub-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/upgradeLiquidityHub.ts --network BASE", "upgrade-rebalancer-basesepolia": "hardhat run ./scripts/upgradeRebalancer.ts --network BASE_SEPOLIA", "upgrade-rebalancer-base": "hardhat run ./scripts/upgradeRebalancer.ts --network BASE", "upgrade-rebalancer-base-stage": "DEPLOY_TYPE=STAGE hardhat run ./scripts/upgradeRebalancer.ts --network BASE", @@ -77,7 +83,12 @@ "dry:deploy-usdcpoolaavelongterm-ethereum": "DRY_RUN=ETHEREUM VERIFY=false ts-node --files ./scripts/deployUSDCPoolAaveLongTerm.ts", "dry:deploy-usdcpool-ethereum": "DRY_RUN=ETHEREUM VERIFY=false ts-node --files ./scripts/deployUSDCPool.ts", "dry:deploy-usdcpool-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPool.ts", + "dry:deploy-usdcpoolaave-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPoolAave.ts", "dry:deploy-usdcstablecoinpool-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCStablecoinPool.ts", + "dry:deploy-usdcpool-opmainnet-stage": "DRY_RUN=OP_MAINNET DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPool.ts", + "dry:deploy-usdcpoolaave-opmainnet-stage": "DRY_RUN=OP_MAINNET DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPoolAave.ts", + "dry:deploy-usdcpool-arbitrumone-stage": "DRY_RUN=ARBITRUM_ONE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPool.ts", + "dry:deploy-usdcpoolaave-arbitrumone-stage": "DRY_RUN=ARBITRUM_ONE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPoolAave.ts", "dry:deploy-usdcpoolaavelongterm-arbitrumone-stage": "DRY_RUN=ARBITRUM_ONE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/deployUSDCPoolAaveLongTerm.ts", "dry:deploy-repayer-base": "DRY_RUN=BASE VERIFY=false ts-node --files ./scripts/deployRepayer.ts", "dry:deploy-repayer-arbitrumone": "DRY_RUN=ARBITRUM_ONE VERIFY=false ts-node --files ./scripts/deployRepayer.ts", @@ -96,6 +107,7 @@ "dry:deploy-spark-stage-repayer-opmainnet": "DRY_RUN=OP_MAINNET STANDALONE_REPAYER_ENV=SparkStage VERIFY=false ts-node --files ./scripts/deployStandaloneRepayer.ts", "dry:upgrade-liquidityhub-basesepolia": "DRY_RUN=BASE_SEPOLIA VERIFY=false ts-node --files ./scripts/upgradeLiquidityHub.ts", "dry:upgrade-liquidityhub-base": "DRY_RUN=BASE VERIFY=false ts-node --files ./scripts/upgradeLiquidityHub.ts", + "dry:upgrade-liquidityhub-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/upgradeLiquidityHub.ts", "dry:upgrade-rebalancer-basesepolia": "DRY_RUN=BASE_SEPOLIA VERIFY=false ts-node --files ./scripts/upgradeRebalancer.ts", "dry:upgrade-rebalancer-base": "DRY_RUN=BASE VERIFY=false ts-node --files ./scripts/upgradeRebalancer.ts", "dry:upgrade-rebalancer-base-stage": "DRY_RUN=BASE DEPLOY_TYPE=STAGE VERIFY=false ts-node --files ./scripts/upgradeRebalancer.ts", diff --git a/scripts/helpers.ts b/scripts/helpers.ts index 1dde76e..74f4e57 100644 --- a/scripts/helpers.ts +++ b/scripts/helpers.ts @@ -241,7 +241,10 @@ export async function addLocalPool( condition: any, network: Network, routes: {Pool: string, Domain: Network, Provider: Provider, SupportsAllTokens?: boolean}[], - versions: string[], + versions: (typeof LiquidityPoolUSDCVersions) + | (typeof LiquidityPoolAaveUSDCVersions) + | (typeof LiquidityPoolUSDCStablecoinVersions) + | (typeof LiquidityPoolAaveUSDCLongTermVersions), supportsAllTokens: boolean, poolName: string, ): Promise { diff --git a/scripts/upgradeLiquidityHub.ts b/scripts/upgradeLiquidityHub.ts index 374d16f..e5af800 100644 --- a/scripts/upgradeLiquidityHub.ts +++ b/scripts/upgradeLiquidityHub.ts @@ -2,10 +2,10 @@ import dotenv from "dotenv"; dotenv.config(); import hre from "hardhat"; import {getVerifier, upgradeProxyX, getHardhatNetworkConfig, getNetworkConfig} from "./helpers"; -import {getDeployProxyXAddress, getContractAt} from "../test/helpers"; +import {getDeployProxyXAddress, getContractAt, resolveXAddress} from "../test/helpers"; import {isSet, assert} from "./common"; import {LiquidityHub} from "../typechain-types"; -import {Network} from "../network.config"; +import {Network, NetworkConfig} from "../network.config"; export async function main() { const [deployer] = await hre.ethers.getSigners(); @@ -17,17 +17,26 @@ export async function main() { console.log(`Upgrade ID: ${process.env.UPGRADE_ID}`); let network: Network; + let config: NetworkConfig; console.log("Upgrading Liquidity Hub"); - ({network} = await getNetworkConfig()); + ({network, config} = await getNetworkConfig()); if (!network) { - ({network} = await getHardhatNetworkConfig()); + ({network, config} = await getHardhatNetworkConfig()); } + assert(config.Hub, "LiquidityHub must be defined"); + const liquidityHubAddress = await getDeployProxyXAddress("LiquidityHub"); const liquidityHub = (await getContractAt("LiquidityHub", liquidityHubAddress)) as LiquidityHub; const lpToken = await liquidityHub.SHARES(); - const liquidityPool = await liquidityHub.LIQUIDITY_POOL(); + + let liquidityPool = await liquidityHub.LIQUIDITY_POOL(); + + if (config.Hub.Pool) { + liquidityPool = await resolveXAddress(config.Hub.Pool); + } + console.log(`Liquidity Pool: ${liquidityPool}`); await upgradeProxyX( verifier.deployX,