From a04d6d4f0595030e0a8db3398a58acc2896c3ea1 Mon Sep 17 00:00:00 2001 From: Oleg Kirillovich Date: Sun, 15 Sep 2024 01:12:43 +0300 Subject: [PATCH] proxyTypes upd --- .../hardhat/tasks/concero/deployInfra/deployInfra.ts | 9 +++++---- .../hardhat/tasks/concero/deployPool/deployChildPool.ts | 4 ++-- .../hardhat/tasks/concero/deployPool/deployParentPool.ts | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/hardhat/tasks/concero/deployInfra/deployInfra.ts b/packages/hardhat/tasks/concero/deployInfra/deployInfra.ts index b31ba05d..8e7a949d 100644 --- a/packages/hardhat/tasks/concero/deployInfra/deployInfra.ts +++ b/packages/hardhat/tasks/concero/deployInfra/deployInfra.ts @@ -16,6 +16,7 @@ import { compileContracts } from "../../../utils/compileContracts"; import { ensureWalletBalance } from "../ensureBalances/ensureNativeBalances"; import { DeployInfraParams } from "./types"; import { deployerTargetBalances } from "../../../constants/targetBalances"; +import { ProxyType } from "../../../constants/deploymentVariables"; task("deploy-infra", "Deploy the CCIP infrastructure") .addFlag("deployproxy", "Deploy the proxy") @@ -56,10 +57,10 @@ async function deployInfra(params: DeployInfraParams) { if (deployProxy) { await ensureWalletBalance(proxyDeployer, deployerTargetBalances, CNetworks[name]); - await deployProxyAdmin(hre, "infraProxy"); - await deployTransparentProxy(hre, "infraProxy"); + await deployProxyAdmin(hre, ProxyType.infraProxy); + await deployTransparentProxy(hre, ProxyType.infraProxy); - const [proxyAddress, _] = getEnvAddress("infraProxy", name); + const [proxyAddress, _] = getEnvAddress(ProxyType.infraProxy, name); const { functionsSubIds } = CNetworks[name]; await addCLFConsumer(CNetworks[name], [proxyAddress], functionsSubIds[0]); } @@ -70,7 +71,7 @@ async function deployInfra(params: DeployInfraParams) { await deployConceroDexSwap(hre); await deployConcero(hre, { slotId }); await deployConceroOrchestrator(hre); - await upgradeProxyImplementation(hre, "infraProxy", false); + await upgradeProxyImplementation(hre, ProxyType.infraProxy, false); } if (setVars) { diff --git a/packages/hardhat/tasks/concero/deployPool/deployChildPool.ts b/packages/hardhat/tasks/concero/deployPool/deployChildPool.ts index b1a61cef..61329e0f 100644 --- a/packages/hardhat/tasks/concero/deployPool/deployChildPool.ts +++ b/packages/hardhat/tasks/concero/deployPool/deployChildPool.ts @@ -16,8 +16,8 @@ task("deploy-child-pool", "Deploy the pool") const hre: HardhatRuntimeEnvironment = require("hardhat"); if (taskArgs.deployproxy) { - await deployProxyAdmin(hre, "childPoolProxy"); - await deployTransparentProxy(hre, "childPoolProxy"); + await deployProxyAdmin(hre, ProxyType.childPoolProxy); + await deployTransparentProxy(hre, ProxyType.childPoolProxy); } if (taskArgs.deployimplementation) { diff --git a/packages/hardhat/tasks/concero/deployPool/deployParentPool.ts b/packages/hardhat/tasks/concero/deployPool/deployParentPool.ts index ed6685e0..d7ff5f90 100644 --- a/packages/hardhat/tasks/concero/deployPool/deployParentPool.ts +++ b/packages/hardhat/tasks/concero/deployPool/deployParentPool.ts @@ -13,6 +13,7 @@ import { upgradeProxyImplementation } from "../upgradeProxyImplementation"; import deployParentPool from "../../../deploy/09_ParentPool"; import deployProxyAdmin from "../../../deploy/10_ConceroProxyAdmin"; import { zeroAddress } from "viem"; +import { ProxyType } from "../../../constants/deploymentVariables"; task("deploy-parent-pool", "Deploy the pool") .addFlag("deployproxy", "Deploy the proxy") @@ -30,16 +31,16 @@ task("deploy-parent-pool", "Deploy the pool") const deployableChains: CNetwork[] = [CNetworks[hre.network.name]]; if (taskArgs.deployproxy) { - await deployProxyAdmin(hre, "parentPoolProxy"); - await deployTransparentProxy(hre, "parentPoolProxy"); - const [proxyAddress, _] = getEnvAddress("parentPoolProxy", name); + await deployProxyAdmin(hre, ProxyType.parentPoolProxy); + await deployTransparentProxy(hre, ProxyType.parentPoolProxy); + const [proxyAddress, _] = getEnvAddress(ProxyType.parentPoolProxy, name); const { functionsSubIds } = chains[name]; await addCLFConsumer(chains[name], [proxyAddress], functionsSubIds[0]); } if (taskArgs.deployimplementation) { await deployParentPool(hre, { automationForwarder: taskArgs.automationforwarder }); //todo: not passing slotId to deployParentPool functions' constructor args - await upgradeProxyImplementation(hre, "parentPoolProxy", false); + await upgradeProxyImplementation(hre, ProxyType.parentPoolProxy, false); } if (taskArgs.uploadsecrets) {