From 914a8ceed0aeb605669cd01301b1cb4ba38566f2 Mon Sep 17 00:00:00 2001 From: Prosper Date: Tue, 1 Oct 2024 19:32:44 +0100 Subject: [PATCH] chore: update gateway contract addresses and deployment script - Remove the empty IMPLEMENTATION field in the NETWORKS constant - Update the GATEWAY_IMPLEMENTATION field in the 84532 network - Update the RPC_URL and SUPPORTED_TOKENS fields in the 84532 network - Update the updateConfigFile function to replace IMPLEMENTATION with GATEWAY_IMPLEMENTATION - Fix the condition in the main function to deploy a new Gateway proxy --- scripts/config.ts | 3 +-- scripts/deploy.ts | 5 +++-- scripts/utils.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/config.ts b/scripts/config.ts index 15c1a93..b24cc96 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -48,7 +48,6 @@ const NETWORKS = { }, TREASURY_FEE_PERCENT: 100, // in BPS i.e 0.1% GATEWAY_CONTRACT: "0x1FA0EE7F9410F6fa49B7AD5Da72Cf01647090028", - IMPLEMENTATION: "", }, /** @@ -154,7 +153,7 @@ const NETWORKS = { * @dev Base Sepolia */ 84532: { - IMPLEMENTATION: "0xff0E00E0110C1FBb5315D276243497b66D3a4d8a", + GATEWAY_IMPLEMENTATION: "0xff0E00E0110C1FBb5315D276243497b66D3a4d8a", RPC_URL: `https://rpc.shield3.com/v3/0x14a34/${SHIELD3_API_KEY}/rpc`, SUPPORTED_TOKENS: { USDC: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", diff --git a/scripts/deploy.ts b/scripts/deploy.ts index c6246d2..93021b2 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -57,8 +57,9 @@ async function deployGateway(): Promise { async function main() { - const response = await waitForInput("\nDo you want to deploy a new Gateway proxy? y/N\n"); - if (response !== "y") { + const response = await waitForInput("\nDo you want to deploy a new Gateway proxy? y\n"); + const responseStr = response as string; // Cast response to string + if (responseStr.toLowerCase() !== "y") { await deployGateway(); } else { await deployGatewayProxy(); diff --git a/scripts/utils.ts b/scripts/utils.ts index 7c171ae..9b72ac4 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -101,15 +101,15 @@ export async function updateConfigFile(chainId: number, implementationAddress: s configContent = configContent.replace(networkRegex, (match) => { const lines = match.split('\n'); const updatedLines = lines.map(line => { - if (line.trim().startsWith('IMPLEMENTATION:')) { - return line.replace(/IMPLEMENTATION:.*/, `IMPLEMENTATION: "${implementationAddress}",`); + if (line.trim().startsWith('GATEWAY_IMPLEMENTATION:')) { + return line.replace(/IMPLEMENTATION:.*/, `GATEWAY_IMPLEMENTATION: "${implementationAddress}",`); } return line; }); - if (!updatedLines.some(line => line.trim().startsWith('IMPLEMENTATION:'))) { + if (!updatedLines.some(line => line.trim().startsWith('GATEWAY_IMPLEMENTATION:'))) { // If IMPLEMENTATION doesn't exist, add it before the closing brace - updatedLines.splice(-1, 0, `\t\tIMPLEMENTATION: "${implementationAddress}",`); + updatedLines.splice(-1, 0, `\t\GATEWAY_IMPLEMENTATION: "${implementationAddress}",`); } return updatedLines.join('\n');