From 2ef4ad59db90354b53e4e9a92491d82b5df73ee0 Mon Sep 17 00:00:00 2001 From: Pierre Bertet Date: Fri, 12 Apr 2024 15:29:36 +0100 Subject: [PATCH] utils/deployment-artifacts-to-app-env: remove CHAIN_ID Other CHAIN_* parameters are needed anyway, so this is usually defined elsewhere. --- .../utils/deployment-artifacts-to-app-env.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/contracts/utils/deployment-artifacts-to-app-env.ts b/contracts/utils/deployment-artifacts-to-app-env.ts index 3994c8e9..07ef21b9 100644 --- a/contracts/utils/deployment-artifacts-to-app-env.ts +++ b/contracts/utils/deployment-artifacts-to-app-env.ts @@ -14,12 +14,7 @@ Options: `; const ZAddress = z.string().regex(/^0x[0-9a-fA-F]{40}$/); - const ZDeploymentContext = z.object({ - options: z.object({ - chainId: z.number(), - rpcUrl: z.string(), - }), deployedContracts: z.record(ZAddress), }); @@ -45,12 +40,12 @@ export async function main() { process.exit(1); } - const deploymentContext = parseDeploymentContext( + const { deployedContracts } = parseDeploymentContext( await fs.readFile(options.inputJsonPath, "utf-8"), ); const outputEnv = objectToEnvironmentVariables( - deploymentContextToAppEnvVariables(deploymentContext), + deployedContractsToAppEnvVariables(deployedContracts), ); await fs.ensureFile(options.outputEnvPath); @@ -70,10 +65,8 @@ function objectToEnvironmentVariables(object: Record) { .join("\n"); } -function deploymentContextToAppEnvVariables({ deployedContracts, options }: DeploymentContext) { - const appEnvVariables: Record = { - NEXT_PUBLIC_CHAIN_ID: String(options.chainId), - }; +function deployedContractsToAppEnvVariables(deployedContracts: DeploymentContext["deployedContracts"]) { + const appEnvVariables: Record = {}; for (const [contractName, address] of Object.entries(deployedContracts)) { const envVarName = contractNameToAppEnvVariable(contractName);