From d4ebe9036135fdb14419df98ee144012e46b87af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Thu, 5 Oct 2023 21:21:18 +0200 Subject: [PATCH] feat: remove DAI gateway from deployment script --- .../foundry/DeployL1BridgeContracts.s.sol | 16 +------------- .../foundry/DeployL2BridgeContracts.s.sol | 14 ------------ .../foundry/InitializeL1BridgeContracts.s.sol | 22 +++---------------- .../foundry/InitializeL2BridgeContracts.s.sol | 22 +++---------------- 4 files changed, 7 insertions(+), 67 deletions(-) diff --git a/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol b/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol index 85a4a1a2c7..b6b1a8f140 100644 --- a/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol +++ b/contracts/scripts/foundry/DeployL1BridgeContracts.s.sol @@ -17,7 +17,6 @@ import {L1MessageQueue} from "../../src/L1/rollup/L1MessageQueue.sol"; import {L1ScrollMessenger} from "../../src/L1/L1ScrollMessenger.sol"; import {L1StandardERC20Gateway} from "../../src/L1/gateways/L1StandardERC20Gateway.sol"; import {L1WETHGateway} from "../../src/L1/gateways/L1WETHGateway.sol"; -import {L1DAIGateway} from "../../src/L1/gateways/L1DAIGateway.sol"; import {L2GasPriceOracle} from "../../src/L1/rollup/L2GasPriceOracle.sol"; import {MultipleVersionRollupVerifier} from "../../src/L1/rollup/MultipleVersionRollupVerifier.sol"; import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol"; @@ -27,7 +26,7 @@ import {ZkEvmVerifierV1} from "../../src/libraries/verifier/ZkEvmVerifierV1.sol" contract DeployL1BridgeContracts is Script { uint256 L1_DEPLOYER_PRIVATE_KEY = vm.envUint("L1_DEPLOYER_PRIVATE_KEY"); - uint32 CHAIN_ID_L2 = uint32(vm.envUint("CHAIN_ID_L2")); + uint64 CHAIN_ID_L2 = uint64(vm.envUint("CHAIN_ID_L2")); address L1_WETH_ADDR = vm.envAddress("L1_WETH_ADDR"); address L2_WETH_ADDR = vm.envAddress("L2_WETH_ADDR"); @@ -56,7 +55,6 @@ contract DeployL1BridgeContracts is Script { deployL1CustomERC20Gateway(); deployL1ERC721Gateway(); deployL1ERC1155Gateway(); - deployL1DAIGateway(); vm.stopBroadcast(); } @@ -204,18 +202,6 @@ contract DeployL1BridgeContracts is Script { logAddress("L1_CUSTOM_ERC20_GATEWAY_PROXY_ADDR", address(proxy)); } - function deployL1DAIGateway() internal { - L1DAIGateway impl = new L1DAIGateway(); - TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( - address(impl), - address(proxyAdmin), - new bytes(0) - ); - - logAddress("L1_DAI_GATEWAY_IMPLEMENTATION_ADDR", address(impl)); - logAddress("L1_DAI_GATEWAY_PROXY_ADDR", address(proxy)); - } - function deployL1ERC721Gateway() internal { L1ERC721Gateway impl = new L1ERC721Gateway(); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( diff --git a/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol b/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol index c47086a7fd..43d42f05b1 100644 --- a/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol +++ b/contracts/scripts/foundry/DeployL2BridgeContracts.s.sol @@ -15,7 +15,6 @@ import {L2GatewayRouter} from "../../src/L2/gateways/L2GatewayRouter.sol"; import {L2ScrollMessenger} from "../../src/L2/L2ScrollMessenger.sol"; import {L2StandardERC20Gateway} from "../../src/L2/gateways/L2StandardERC20Gateway.sol"; import {L2WETHGateway} from "../../src/L2/gateways/L2WETHGateway.sol"; -import {L2DAIGateway} from "../../src/L2/gateways/L2DAIGateway.sol"; import {L1GasPriceOracle} from "../../src/L2/predeploys/L1GasPriceOracle.sol"; import {L2MessageQueue} from "../../src/L2/predeploys/L2MessageQueue.sol"; import {L2TxFeeVault} from "../../src/L2/predeploys/L2TxFeeVault.sol"; @@ -60,7 +59,6 @@ contract DeployL2BridgeContracts is Script { deployL2CustomERC20Gateway(); deployL2ERC721Gateway(); deployL2ERC1155Gateway(); - deployL2DAIGateway(); vm.stopBroadcast(); } @@ -201,18 +199,6 @@ contract DeployL2BridgeContracts is Script { logAddress("L2_CUSTOM_ERC20_GATEWAY_PROXY_ADDR", address(proxy)); } - function deployL2DAIGateway() internal { - L2DAIGateway impl = new L2DAIGateway(); - TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( - address(impl), - address(proxyAdmin), - new bytes(0) - ); - - logAddress("L2_DAI_GATEWAY_IMPLEMENTATION_ADDR", address(impl)); - logAddress("L2_DAI_GATEWAY_PROXY_ADDR", address(proxy)); - } - function deployL2ERC721Gateway() internal { L2ERC721Gateway impl = new L2ERC721Gateway(); TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( diff --git a/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol b/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol index 66b03de5d7..e833b811ee 100644 --- a/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol +++ b/contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol @@ -11,7 +11,6 @@ import {L1GatewayRouter} from "../../src/L1/gateways/L1GatewayRouter.sol"; import {L1ScrollMessenger} from "../../src/L1/L1ScrollMessenger.sol"; import {L1StandardERC20Gateway} from "../../src/L1/gateways/L1StandardERC20Gateway.sol"; import {L1WETHGateway} from "../../src/L1/gateways/L1WETHGateway.sol"; -import {L1DAIGateway} from "../../src/L1/gateways/L1DAIGateway.sol"; import {MultipleVersionRollupVerifier} from "../../src/L1/rollup/MultipleVersionRollupVerifier.sol"; import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol"; import {L1MessageQueue} from "../../src/L1/rollup/L1MessageQueue.sol"; @@ -29,9 +28,6 @@ contract InitializeL1BridgeContracts is Script { address L1_FEE_VAULT_ADDR = vm.envAddress("L1_FEE_VAULT_ADDR"); address L1_WETH_ADDR = vm.envAddress("L1_WETH_ADDR"); - address L1_DAI_ADDR = vm.envAddress("L1_DAI_ADDR"); - address L2_DAI_ADDR = vm.envAddress("L2_DAI_ADDR"); - address L1_WHITELIST_ADDR = vm.envAddress("L1_WHITELIST_ADDR"); address L1_SCROLL_CHAIN_PROXY_ADDR = vm.envAddress("L1_SCROLL_CHAIN_PROXY_ADDR"); address L1_MESSAGE_QUEUE_PROXY_ADDR = vm.envAddress("L1_MESSAGE_QUEUE_PROXY_ADDR"); @@ -44,7 +40,6 @@ contract InitializeL1BridgeContracts is Script { address L1_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_ETH_GATEWAY_PROXY_ADDR"); address L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR"); address L1_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_WETH_GATEWAY_PROXY_ADDR"); - address L1_DAI_GATEWAY_PROXY_ADDR = vm.envAddress("L1_DAI_GATEWAY_PROXY_ADDR"); address L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); address L1_ENFORCED_TX_GATEWAY_PROXY_ADDR = vm.envAddress("L1_ENFORCED_TX_GATEWAY_PROXY_ADDR"); @@ -56,7 +51,6 @@ contract InitializeL1BridgeContracts is Script { address L2_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L2_ETH_GATEWAY_PROXY_ADDR"); address L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR"); address L2_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L2_WETH_GATEWAY_PROXY_ADDR"); - address L2_DAI_GATEWAY_PROXY_ADDR = vm.envAddress("L2_DAI_GATEWAY_PROXY_ADDR"); address L2_SCROLL_STANDARD_ERC20_ADDR = vm.envAddress("L2_SCROLL_STANDARD_ERC20_ADDR"); address L2_SCROLL_STANDARD_ERC20_FACTORY_ADDR = vm.envAddress("L2_SCROLL_STANDARD_ERC20_FACTORY_ADDR"); @@ -155,22 +149,12 @@ contract InitializeL1BridgeContracts is Script { L1_SCROLL_MESSENGER_PROXY_ADDR ); - // initialize L1DAIGateway - L1DAIGateway(L1_DAI_GATEWAY_PROXY_ADDR).initialize( - L2_DAI_GATEWAY_PROXY_ADDR, - L1_GATEWAY_ROUTER_PROXY_ADDR, - L1_SCROLL_MESSENGER_PROXY_ADDR - ); - L1DAIGateway(L1_DAI_GATEWAY_PROXY_ADDR).updateTokenMapping(L1_DAI_ADDR, L2_DAI_ADDR); - - // set WETH and DAI gateways in router + // set WETH gateway in router { - address[] memory _tokens = new address[](2); + address[] memory _tokens = new address[](1); _tokens[0] = L1_WETH_ADDR; - _tokens[1] = L1_DAI_ADDR; - address[] memory _gateways = new address[](2); + address[] memory _gateways = new address[](1); _gateways[0] = L1_WETH_GATEWAY_PROXY_ADDR; - _gateways[1] = L1_DAI_GATEWAY_PROXY_ADDR; L1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).setERC20Gateway(_tokens, _gateways); } diff --git a/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol b/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol index bf7444deba..df30835e0a 100644 --- a/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol +++ b/contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol @@ -11,7 +11,6 @@ import {L2ETHGateway} from "../../src/L2/gateways/L2ETHGateway.sol"; import {L2GatewayRouter} from "../../src/L2/gateways/L2GatewayRouter.sol"; import {L2StandardERC20Gateway} from "../../src/L2/gateways/L2StandardERC20Gateway.sol"; import {L2WETHGateway} from "../../src/L2/gateways/L2WETHGateway.sol"; -import {L2DAIGateway} from "../../src/L2/gateways/L2DAIGateway.sol"; import {L2MessageQueue} from "../../src/L2/predeploys/L2MessageQueue.sol"; import {L2TxFeeVault} from "../../src/L2/predeploys/L2TxFeeVault.sol"; import {L1GasPriceOracle} from "../../src/L2/predeploys/L1GasPriceOracle.sol"; @@ -23,9 +22,6 @@ contract InitializeL2BridgeContracts is Script { address L2_WETH_ADDR = vm.envAddress("L2_WETH_ADDR"); - address L1_DAI_ADDR = vm.envAddress("L1_DAI_ADDR"); - address L2_DAI_ADDR = vm.envAddress("L2_DAI_ADDR"); - address L1_SCROLL_MESSENGER_PROXY_ADDR = vm.envAddress("L1_SCROLL_MESSENGER_PROXY_ADDR"); address L1_GATEWAY_ROUTER_PROXY_ADDR = vm.envAddress("L1_GATEWAY_ROUTER_PROXY_ADDR"); address L1_CUSTOM_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L1_CUSTOM_ERC20_GATEWAY_PROXY_ADDR"); @@ -34,7 +30,6 @@ contract InitializeL2BridgeContracts is Script { address L1_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_ETH_GATEWAY_PROXY_ADDR"); address L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR"); address L1_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_WETH_GATEWAY_PROXY_ADDR"); - address L1_DAI_GATEWAY_PROXY_ADDR = vm.envAddress("L1_DAI_GATEWAY_PROXY_ADDR"); address L2_TX_FEE_VAULT_ADDR = vm.envAddress("L2_TX_FEE_VAULT_ADDR"); address L1_GAS_PRICE_ORACLE_ADDR = vm.envAddress("L1_GAS_PRICE_ORACLE_ADDR"); @@ -49,7 +44,6 @@ contract InitializeL2BridgeContracts is Script { address L2_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L2_ETH_GATEWAY_PROXY_ADDR"); address L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR"); address L2_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L2_WETH_GATEWAY_PROXY_ADDR"); - address L2_DAI_GATEWAY_PROXY_ADDR = vm.envAddress("L2_DAI_GATEWAY_PROXY_ADDR"); address L2_SCROLL_STANDARD_ERC20_FACTORY_ADDR = vm.envAddress("L2_SCROLL_STANDARD_ERC20_FACTORY_ADDR"); function run() external { @@ -114,22 +108,12 @@ contract InitializeL2BridgeContracts is Script { L2_SCROLL_MESSENGER_PROXY_ADDR ); - // initialize L2DAIGateway - L2DAIGateway(L2_DAI_GATEWAY_PROXY_ADDR).initialize( - L1_DAI_GATEWAY_PROXY_ADDR, - L2_GATEWAY_ROUTER_PROXY_ADDR, - L2_SCROLL_MESSENGER_PROXY_ADDR - ); - L2DAIGateway(L2_DAI_GATEWAY_PROXY_ADDR).updateTokenMapping(L2_DAI_ADDR, L1_DAI_ADDR); - - // set WETH and DAI gateways in router + // set WETH gateway in router { - address[] memory _tokens = new address[](2); + address[] memory _tokens = new address[](1); _tokens[0] = L2_WETH_ADDR; - _tokens[1] = L2_DAI_ADDR; - address[] memory _gateways = new address[](2); + address[] memory _gateways = new address[](1); _gateways[0] = L2_WETH_GATEWAY_PROXY_ADDR; - _gateways[1] = L2_DAI_GATEWAY_PROXY_ADDR; L2GatewayRouter(L2_GATEWAY_ROUTER_PROXY_ADDR).setERC20Gateway(_tokens, _gateways); }