From b3cadf2494809d9e80f653ec9c8dc03ea0369285 Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Fri, 1 Dec 2023 14:04:25 +0100 Subject: [PATCH 1/2] disallow l2 weth upgrade --- zksync/src/upgradeL2BridgeImpl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zksync/src/upgradeL2BridgeImpl.ts b/zksync/src/upgradeL2BridgeImpl.ts index e7c4fe170..8984f556a 100644 --- a/zksync/src/upgradeL2BridgeImpl.ts +++ b/zksync/src/upgradeL2BridgeImpl.ts @@ -129,7 +129,7 @@ async function getTxInfo( if (contract === "L2ERC20Bridge") { return getTransparentProxyUpgradeTxInfo(deployer, target, l2Erc20BridgeProxyAddress, refundRecipient, gasPrice); } else if (contract == "L2Weth") { - return getTransparentProxyUpgradeTxInfo(deployer, target, l2WethProxyAddress, refundRecipient, gasPrice); + throw new Error('The latest L2Weth implementation requires L2WethBridge to be deployed in order to be correctly initialized, which is not the case on the majority of networks. Remove this error once the bridge is deployed.'); } else if (contract == "L2StandardERC20") { if (!l2ProxyAddress) { console.log("Explicit beacon address is not supplied, requesting the one from L2 node"); From 0a758cae6b185a1d3e327d216347ea7dddacf2ad Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Fri, 1 Dec 2023 14:07:57 +0100 Subject: [PATCH 2/2] fix lint --- zksync/src/upgradeL2BridgeImpl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zksync/src/upgradeL2BridgeImpl.ts b/zksync/src/upgradeL2BridgeImpl.ts index 8984f556a..0fb38aa64 100644 --- a/zksync/src/upgradeL2BridgeImpl.ts +++ b/zksync/src/upgradeL2BridgeImpl.ts @@ -27,7 +27,6 @@ function checkSupportedContract(contract: any): contract is SupportedContracts { const priorityTxMaxGasLimit = getNumberFromEnv("CONTRACTS_PRIORITY_TX_MAX_GAS_LIMIT"); const l2Erc20BridgeProxyAddress = getAddressFromEnv("CONTRACTS_L2_ERC20_BRIDGE_ADDR"); -const l2WethProxyAddress = getAddressFromEnv("CONTRACTS_L2_WETH_TOKEN_PROXY_ADDR"); const EIP1967_IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"; const provider = web3Provider(); @@ -129,7 +128,9 @@ async function getTxInfo( if (contract === "L2ERC20Bridge") { return getTransparentProxyUpgradeTxInfo(deployer, target, l2Erc20BridgeProxyAddress, refundRecipient, gasPrice); } else if (contract == "L2Weth") { - throw new Error('The latest L2Weth implementation requires L2WethBridge to be deployed in order to be correctly initialized, which is not the case on the majority of networks. Remove this error once the bridge is deployed.'); + throw new Error( + "The latest L2Weth implementation requires L2WethBridge to be deployed in order to be correctly initialized, which is not the case on the majority of networks. Remove this error once the bridge is deployed." + ); } else if (contract == "L2StandardERC20") { if (!l2ProxyAddress) { console.log("Explicit beacon address is not supplied, requesting the one from L2 node");