Skip to content

Commit

Permalink
proxyTypes upd
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkron committed Sep 14, 2024
1 parent f5416e9 commit a04d6d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions packages/hardhat/tasks/concero/deployInfra/deployInfra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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]);
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat/tasks/concero/deployPool/deployChildPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 5 additions & 4 deletions packages/hardhat/tasks/concero/deployPool/deployParentPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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) {
Expand Down

0 comments on commit a04d6d4

Please sign in to comment.