Skip to content

Commit

Permalink
chore: update gateway contract addresses and deployment script
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
OnahProsperity authored and chibie committed Oct 14, 2024
1 parent c58483f commit 914a8ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const NETWORKS = {
},
TREASURY_FEE_PERCENT: 100, // in BPS i.e 0.1%
GATEWAY_CONTRACT: "0x1FA0EE7F9410F6fa49B7AD5Da72Cf01647090028",
IMPLEMENTATION: "",
},

/**
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ async function deployGateway(): Promise<any> {


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();
Expand Down
8 changes: 4 additions & 4 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 914a8ce

Please sign in to comment.