Skip to content

Commit

Permalink
feat: remove DAI gateway from deployment script (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram authored Oct 6, 2023
1 parent 3143373 commit 0cdb0dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 67 deletions.
16 changes: 1 addition & 15 deletions contracts/scripts/foundry/DeployL1BridgeContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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");
Expand Down Expand Up @@ -56,7 +55,6 @@ contract DeployL1BridgeContracts is Script {
deployL1CustomERC20Gateway();
deployL1ERC721Gateway();
deployL1ERC1155Gateway();
deployL1DAIGateway();

vm.stopBroadcast();
}
Expand Down Expand Up @@ -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(
Expand Down
14 changes: 0 additions & 14 deletions contracts/scripts/foundry/DeployL2BridgeContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -60,7 +59,6 @@ contract DeployL2BridgeContracts is Script {
deployL2CustomERC20Gateway();
deployL2ERC721Gateway();
deployL2ERC1155Gateway();
deployL2DAIGateway();

vm.stopBroadcast();
}
Expand Down Expand Up @@ -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(
Expand Down
22 changes: 3 additions & 19 deletions contracts/scripts/foundry/InitializeL1BridgeContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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");
Expand All @@ -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");

Expand All @@ -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");

Expand Down Expand Up @@ -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);
}

Expand Down
22 changes: 3 additions & 19 deletions contracts/scripts/foundry/InitializeL2BridgeContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 0cdb0dc

Please sign in to comment.