From b70cc57704d750081a62a7e8e44f68f32efdc4c1 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:23:48 +0800 Subject: [PATCH] refactor(protocol): added cached version of the bridge and vaults (#17801) --- .../protocol/contracts/libs/LibNetwork.sol | 26 +++---- ...essCache.sol => LibRollupAddressCache.sol} | 7 +- .../mainnet/LibSharedAddressCache.sol | 69 +++++++++++++++++++ .../contracts/mainnet/MainnetBridge.sol | 18 +++++ .../contracts/mainnet/MainnetERC1155Vault.sol | 18 +++++ .../contracts/mainnet/MainnetERC20Vault.sol | 18 +++++ .../contracts/mainnet/MainnetERC721Vault.sol | 18 +++++ .../contracts/mainnet/MainnetProverSet.sol | 7 +- .../mainnet/MainnetRollupAddressManager.sol | 6 +- .../mainnet/MainnetSharedAddressManager.sol | 46 ++----------- .../mainnet/MainnetSignalService.sol | 18 +++++ .../contracts/mainnet/MainnetTaikoL1.sol | 6 +- packages/protocol/contracts/mainnet/README.md | 5 ++ packages/protocol/script/DeployOnL1.s.sol | 35 ++++++++-- 14 files changed, 229 insertions(+), 68 deletions(-) rename packages/protocol/contracts/mainnet/{LibAddressCache.sol => LibRollupAddressCache.sol} (91%) create mode 100644 packages/protocol/contracts/mainnet/LibSharedAddressCache.sol create mode 100644 packages/protocol/contracts/mainnet/MainnetBridge.sol create mode 100644 packages/protocol/contracts/mainnet/MainnetERC1155Vault.sol create mode 100644 packages/protocol/contracts/mainnet/MainnetERC20Vault.sol create mode 100644 packages/protocol/contracts/mainnet/MainnetERC721Vault.sol create mode 100644 packages/protocol/contracts/mainnet/MainnetSignalService.sol create mode 100644 packages/protocol/contracts/mainnet/README.md diff --git a/packages/protocol/contracts/libs/LibNetwork.sol b/packages/protocol/contracts/libs/LibNetwork.sol index e5ddd51bccd..bfa6d62e39e 100644 --- a/packages/protocol/contracts/libs/LibNetwork.sol +++ b/packages/protocol/contracts/libs/LibNetwork.sol @@ -3,13 +3,13 @@ pragma solidity 0.8.24; /// @title LibNetwork library LibNetwork { - uint256 internal constant MAINNET = 1; - uint256 internal constant ROPSTEN = 2; - uint256 internal constant RINKEBY = 4; - uint256 internal constant GOERLI = 5; - uint256 internal constant KOVAN = 42; - uint256 internal constant HOLESKY = 17_000; - uint256 internal constant SEPOLIA = 11_155_111; + uint256 internal constant ETHEREUM_MAINNET = 1; + uint256 internal constant ETHEREUM_ROPSTEN = 2; + uint256 internal constant ETHEREUM_RINKEBY = 4; + uint256 internal constant ETHEREUM_GOERLI = 5; + uint256 internal constant ETHEREUM_KOVAN = 42; + uint256 internal constant ETHEREUM_HOLESKY = 17_000; + uint256 internal constant ETHEREUM_SEPOLIA = 11_155_111; uint64 internal constant TAIKO_MAINNET = 167_000; uint64 internal constant TAIKO_HEKLA = 167_009; @@ -18,9 +18,9 @@ library LibNetwork { /// @param _chainId The chain ID. /// @return true if the chain ID represents an Ethereum testnet, false otherwise. function isEthereumTestnet(uint256 _chainId) internal pure returns (bool) { - return _chainId == LibNetwork.ROPSTEN || _chainId == LibNetwork.RINKEBY - || _chainId == LibNetwork.GOERLI || _chainId == LibNetwork.KOVAN - || _chainId == LibNetwork.HOLESKY || _chainId == LibNetwork.SEPOLIA; + return _chainId == LibNetwork.ETHEREUM_ROPSTEN || _chainId == LibNetwork.ETHEREUM_RINKEBY + || _chainId == LibNetwork.ETHEREUM_GOERLI || _chainId == LibNetwork.ETHEREUM_KOVAN + || _chainId == LibNetwork.ETHEREUM_HOLESKY || _chainId == LibNetwork.ETHEREUM_SEPOLIA; } /// @dev Checks if the chain ID represents an Ethereum testnet or the Etheruem mainnet. @@ -28,7 +28,7 @@ library LibNetwork { /// @return true if the chain ID represents an Ethereum testnet or the Etheruem mainnet, false /// otherwise. function isEthereumMainnetOrTestnet(uint256 _chainId) internal pure returns (bool) { - return _chainId == LibNetwork.MAINNET || isEthereumTestnet(_chainId); + return _chainId == LibNetwork.ETHEREUM_MAINNET || isEthereumTestnet(_chainId); } /// @dev Checks if the chain ID represents the Taiko L2 mainnet. @@ -51,7 +51,7 @@ library LibNetwork { /// @param _chainId The chain ID. /// @return true if the chain supports Dencun hardfork, false otherwise. function isDencunSupported(uint256 _chainId) internal pure returns (bool) { - return _chainId == LibNetwork.MAINNET || _chainId == LibNetwork.HOLESKY - || _chainId == LibNetwork.SEPOLIA || isTaikoDevnet(_chainId); + return _chainId == LibNetwork.ETHEREUM_MAINNET || _chainId == LibNetwork.ETHEREUM_HOLESKY + || _chainId == LibNetwork.ETHEREUM_SEPOLIA || isTaikoDevnet(_chainId); } } diff --git a/packages/protocol/contracts/mainnet/LibAddressCache.sol b/packages/protocol/contracts/mainnet/LibRollupAddressCache.sol similarity index 91% rename from packages/protocol/contracts/mainnet/LibAddressCache.sol rename to packages/protocol/contracts/mainnet/LibRollupAddressCache.sol index 4e46585f456..d25324fb8b6 100644 --- a/packages/protocol/contracts/mainnet/LibAddressCache.sol +++ b/packages/protocol/contracts/mainnet/LibRollupAddressCache.sol @@ -2,10 +2,11 @@ pragma solidity 0.8.24; import "../common/LibStrings.sol"; +import "../libs/LibNetwork.sol"; -/// @title LibAddressCache +/// @title LibRollupAddressCache /// @custom:security-contact security@taiko.xyz -library LibAddressCache { +library LibRollupAddressCache { function getAddress( uint64 _chainId, bytes32 _name @@ -14,7 +15,7 @@ library LibAddressCache { pure returns (bool found, address addr) { - if (_chainId == 1) { + if (_chainId == LibNetwork.ETHEREUM_MAINNET) { if (_name == LibStrings.B_TAIKO_TOKEN) { return (true, 0x10dea67478c5F8C5E2D90e5E9B26dBe60c54d800); } diff --git a/packages/protocol/contracts/mainnet/LibSharedAddressCache.sol b/packages/protocol/contracts/mainnet/LibSharedAddressCache.sol new file mode 100644 index 00000000000..c361f275e5b --- /dev/null +++ b/packages/protocol/contracts/mainnet/LibSharedAddressCache.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../common/LibStrings.sol"; +import "../libs/LibNetwork.sol"; + +/// @title LibSharedAddressCache +/// @custom:security-contact security@taiko.xyz +library LibSharedAddressCache { + function getAddress( + uint64 _chainId, + bytes32 _name + ) + internal + pure + returns (bool found, address addr) + { + if (_chainId == LibNetwork.ETHEREUM_MAINNET) { + if (_name == LibStrings.B_TAIKO_TOKEN) { + return (true, 0x10dea67478c5F8C5E2D90e5E9B26dBe60c54d800); + } + if (_name == LibStrings.B_QUOTA_MANAGER) { + return (true, 0x91f67118DD47d502B1f0C354D0611997B022f29E); + } + if (_name == LibStrings.B_BRIDGE) { + return (true, 0xd60247c6848B7Ca29eDdF63AA924E53dB6Ddd8EC); + } + if (_name == LibStrings.B_BRIDGED_ERC20) { + return (true, 0x79BC0Aada00fcF6E7AB514Bfeb093b5Fae3653e3); + } + if (_name == LibStrings.B_BRIDGED_ERC721) { + return (true, 0xC3310905E2BC9Cfb198695B75EF3e5B69C6A1Bf7); + } + if (_name == LibStrings.B_BRIDGED_ERC1155) { + return (true, 0x3c90963cFBa436400B0F9C46Aa9224cB379c2c40); + } + if (_name == LibStrings.B_ERC20_VAULT) { + return (true, 0x996282cA11E5DEb6B5D122CC3B9A1FcAAD4415Ab); + } + if (_name == LibStrings.B_ERC721_VAULT) { + return (true, 0x0b470dd3A0e1C41228856Fb319649E7c08f419Aa); + } + if (_name == LibStrings.B_ERC1155_VAULT) { + return (true, 0xaf145913EA4a56BE22E120ED9C24589659881702); + } + if (_name == LibStrings.B_SIGNAL_SERVICE) { + return (true, 0x9e0a24964e5397B566c1ed39258e21aB5E35C77C); + } + } else if (_chainId == LibNetwork.TAIKO_MAINNET) { + if (_name == LibStrings.B_BRIDGE) { + return (true, 0x1670000000000000000000000000000000000001); + } + if (_name == LibStrings.B_ERC20_VAULT) { + return (true, 0x1670000000000000000000000000000000000002); + } + if (_name == LibStrings.B_ERC721_VAULT) { + return (true, 0x1670000000000000000000000000000000000003); + } + if (_name == LibStrings.B_ERC1155_VAULT) { + return (true, 0x1670000000000000000000000000000000000004); + } + if (_name == LibStrings.B_SIGNAL_SERVICE) { + return (true, 0x1670000000000000000000000000000000000005); + } + } + + return (false, address(0)); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetBridge.sol b/packages/protocol/contracts/mainnet/MainnetBridge.sol new file mode 100644 index 00000000000..db538fee0d3 --- /dev/null +++ b/packages/protocol/contracts/mainnet/MainnetBridge.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../bridge/Bridge.sol"; +import "./LibSharedAddressCache.sol"; + +/// @title MainnetBridge +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. +/// @notice See the documentation in {Bridge}. +/// @custom:security-contact security@taiko.xyz +contract MainnetBridge is Bridge { + function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetERC1155Vault.sol b/packages/protocol/contracts/mainnet/MainnetERC1155Vault.sol new file mode 100644 index 00000000000..e8071a2f9f9 --- /dev/null +++ b/packages/protocol/contracts/mainnet/MainnetERC1155Vault.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../tokenvault/ERC1155Vault.sol"; +import "./LibSharedAddressCache.sol"; + +/// @title MainnetERC1155Vault +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. +/// @notice See the documentation in {ER1155Vault}. +/// @custom:security-contact security@taiko.xyz +contract MainnetERC1155Vault is ERC1155Vault { + function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetERC20Vault.sol b/packages/protocol/contracts/mainnet/MainnetERC20Vault.sol new file mode 100644 index 00000000000..380aa35073a --- /dev/null +++ b/packages/protocol/contracts/mainnet/MainnetERC20Vault.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../tokenvault/ERC20Vault.sol"; +import "./LibSharedAddressCache.sol"; + +/// @title MainnetERC20Vault +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. +/// @notice See the documentation in {ER20Vault}. +/// @custom:security-contact security@taiko.xyz +contract MainnetERC20Vault is ERC20Vault { + function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetERC721Vault.sol b/packages/protocol/contracts/mainnet/MainnetERC721Vault.sol new file mode 100644 index 00000000000..5c9444065ec --- /dev/null +++ b/packages/protocol/contracts/mainnet/MainnetERC721Vault.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../tokenvault/ERC721Vault.sol"; +import "./LibSharedAddressCache.sol"; + +/// @title MainnetERC721Vault +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. +/// @notice See the documentation in {ER721Vault}. +/// @custom:security-contact security@taiko.xyz +contract MainnetERC721Vault is ERC721Vault { + function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetProverSet.sol b/packages/protocol/contracts/mainnet/MainnetProverSet.sol index 39b79187979..e28f6924717 100644 --- a/packages/protocol/contracts/mainnet/MainnetProverSet.sol +++ b/packages/protocol/contracts/mainnet/MainnetProverSet.sol @@ -2,14 +2,17 @@ pragma solidity 0.8.24; import "../team/proving/ProverSet.sol"; -import "./LibAddressCache.sol"; +import "./LibRollupAddressCache.sol"; /// @title MainnetProverSet +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. /// @notice See the documentation in {ProverSet}. /// @custom:security-contact security@taiko.xyz contract MainnetProverSet is ProverSet { function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { - (bool found, address addr) = LibAddressCache.getAddress(_chainId, _name); + (bool found, address addr) = LibRollupAddressCache.getAddress(_chainId, _name); return found ? addr : super._getAddress(_chainId, _name); } } diff --git a/packages/protocol/contracts/mainnet/MainnetRollupAddressManager.sol b/packages/protocol/contracts/mainnet/MainnetRollupAddressManager.sol index 8e8cda4eda9..a29dbda0eb0 100644 --- a/packages/protocol/contracts/mainnet/MainnetRollupAddressManager.sol +++ b/packages/protocol/contracts/mainnet/MainnetRollupAddressManager.sol @@ -3,14 +3,16 @@ pragma solidity 0.8.24; import "../common/AddressManager.sol"; import "../common/LibStrings.sol"; -import "./LibAddressCache.sol"; +import "./LibRollupAddressCache.sol"; /// @title MainnetRollupAddressManager +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. /// @notice See the documentation in {IAddressManager}. /// @custom:security-contact security@taiko.xyz contract MainnetRollupAddressManager is AddressManager { function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { - (bool found, address addr) = LibAddressCache.getAddress(_chainId, _name); + (bool found, address addr) = LibRollupAddressCache.getAddress(_chainId, _name); return found ? addr : super._getAddress(_chainId, _name); } } diff --git a/packages/protocol/contracts/mainnet/MainnetSharedAddressManager.sol b/packages/protocol/contracts/mainnet/MainnetSharedAddressManager.sol index 87386fa26d1..1ce27eeb68a 100644 --- a/packages/protocol/contracts/mainnet/MainnetSharedAddressManager.sol +++ b/packages/protocol/contracts/mainnet/MainnetSharedAddressManager.sol @@ -3,52 +3,16 @@ pragma solidity 0.8.24; import "../common/AddressManager.sol"; import "../common/LibStrings.sol"; +import "./LibSharedAddressCache.sol"; /// @title MainnetSharedAddressManager +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. /// @notice See the documentation in {IAddressManager}. /// @custom:security-contact security@taiko.xyz contract MainnetSharedAddressManager is AddressManager { function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { - if (_chainId == 1) { - if (_name == LibStrings.B_TAIKO_TOKEN) { - return 0x10dea67478c5F8C5E2D90e5E9B26dBe60c54d800; - } - if (_name == LibStrings.B_QUOTA_MANAGER) { - return 0x91f67118DD47d502B1f0C354D0611997B022f29E; - } - if (_name == LibStrings.B_BRIDGE) { - return 0xd60247c6848B7Ca29eDdF63AA924E53dB6Ddd8EC; - } - if (_name == LibStrings.B_ERC20_VAULT) { - return 0x996282cA11E5DEb6B5D122CC3B9A1FcAAD4415Ab; - } - if (_name == LibStrings.B_ERC721_VAULT) { - return 0x0b470dd3A0e1C41228856Fb319649E7c08f419Aa; - } - if (_name == LibStrings.B_ERC1155_VAULT) { - return 0xaf145913EA4a56BE22E120ED9C24589659881702; - } - if (_name == LibStrings.B_SIGNAL_SERVICE) { - return 0x9e0a24964e5397B566c1ed39258e21aB5E35C77C; - } - } else if (_chainId == 167_000) { - if (_name == LibStrings.B_BRIDGE) { - return 0x1670000000000000000000000000000000000001; - } - if (_name == LibStrings.B_ERC20_VAULT) { - return 0x1670000000000000000000000000000000000002; - } - if (_name == LibStrings.B_ERC721_VAULT) { - return 0x1670000000000000000000000000000000000003; - } - if (_name == LibStrings.B_ERC1155_VAULT) { - return 0x1670000000000000000000000000000000000004; - } - if (_name == LibStrings.B_SIGNAL_SERVICE) { - return 0x1670000000000000000000000000000000000005; - } - } - - return super._getAddress(_chainId, _name); + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); } } diff --git a/packages/protocol/contracts/mainnet/MainnetSignalService.sol b/packages/protocol/contracts/mainnet/MainnetSignalService.sol new file mode 100644 index 00000000000..8dc61ecbe48 --- /dev/null +++ b/packages/protocol/contracts/mainnet/MainnetSignalService.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; + +import "../signal/SignalService.sol"; +import "./LibSharedAddressCache.sol"; + +/// @title MainnetSignalService +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. In theory, the contract can also be deplyed on Taiko L2 but this is +/// not well testee nor necessary. +/// @notice See the documentation in {SignalService}. +/// @custom:security-contact security@taiko.xyz +contract MainnetSignalService is SignalService { + function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { + (bool found, address addr) = LibSharedAddressCache.getAddress(_chainId, _name); + return found ? addr : super._getAddress(_chainId, _name); + } +} diff --git a/packages/protocol/contracts/mainnet/MainnetTaikoL1.sol b/packages/protocol/contracts/mainnet/MainnetTaikoL1.sol index 850e333f643..3b752f1c54d 100644 --- a/packages/protocol/contracts/mainnet/MainnetTaikoL1.sol +++ b/packages/protocol/contracts/mainnet/MainnetTaikoL1.sol @@ -2,14 +2,16 @@ pragma solidity 0.8.24; import "../L1/TaikoL1.sol"; -import "./LibAddressCache.sol"; +import "./LibRollupAddressCache.sol"; /// @title MainnetTaikoL1 +/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko +/// mainnet to reduce gas cost. /// @notice See the documentation in {TaikoL1}. /// @custom:security-contact security@taiko.xyz contract MainnetTaikoL1 is TaikoL1 { function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { - (bool found, address addr) = LibAddressCache.getAddress(_chainId, _name); + (bool found, address addr) = LibRollupAddressCache.getAddress(_chainId, _name); return found ? addr : super._getAddress(_chainId, _name); } } diff --git a/packages/protocol/contracts/mainnet/README.md b/packages/protocol/contracts/mainnet/README.md new file mode 100644 index 00000000000..1f73bd10883 --- /dev/null +++ b/packages/protocol/contracts/mainnet/README.md @@ -0,0 +1,5 @@ +# Optimized Smart Contracts for Taiko Mainnet + +## Overview + +This directory contains optimized versions of smart contracts for deployment on Ethereum for Taiko mainnet. While some of these contracts may be used on Taiko L2, deployment on Layer 2 is not recommended due to lack of testing. diff --git a/packages/protocol/script/DeployOnL1.s.sol b/packages/protocol/script/DeployOnL1.s.sol index ff4d66cc805..12f0a9b3ff0 100644 --- a/packages/protocol/script/DeployOnL1.s.sol +++ b/packages/protocol/script/DeployOnL1.s.sol @@ -9,14 +9,14 @@ import "../contracts/mainnet/MainnetTaikoL1.sol"; import "../contracts/L1/provers/GuardianProver.sol"; import "../contracts/L1/tiers/DevnetTierProvider.sol"; import "../contracts/L1/tiers/TierProviderV2.sol"; -import "../contracts/bridge/Bridge.sol"; +import "../contracts/mainnet/MainnetBridge.sol"; import "../contracts/tokenvault/BridgedERC20.sol"; import "../contracts/tokenvault/BridgedERC721.sol"; import "../contracts/tokenvault/BridgedERC1155.sol"; -import "../contracts/tokenvault/ERC20Vault.sol"; -import "../contracts/tokenvault/ERC1155Vault.sol"; -import "../contracts/tokenvault/ERC721Vault.sol"; -import "../contracts/signal/SignalService.sol"; +import "../contracts/mainnet/MainnetERC20Vault.sol"; +import "../contracts/mainnet/MainnetERC1155Vault.sol"; +import "../contracts/mainnet/MainnetERC721Vault.sol"; +import "../contracts/mainnet/MainnetSignalService.sol"; import "../contracts/automata-attestation/AutomataDcapV3Attestation.sol"; import "../contracts/automata-attestation/utils/SigVerifyLib.sol"; import "../contracts/automata-attestation/lib/PEMCertChainLib.sol"; @@ -151,6 +151,11 @@ contract DeployOnL1 is DeployCapability { } // Deploy Bridging contracts + deployProxy({ + name: "mainnet_signal_service", + impl: address(new MainnetSignalService()), + data: abi.encodeCall(SignalService.init, (address(0), sharedAddressManager)) + }); deployProxy({ name: "signal_service", impl: address(new SignalService()), @@ -158,6 +163,11 @@ contract DeployOnL1 is DeployCapability { registerTo: sharedAddressManager }); + deployProxy({ + name: "mainnet_bridge", + impl: address(new MainnetBridge()), + data: abi.encodeCall(Bridge.init, (address(0), sharedAddressManager)) + }); address brdige = deployProxy({ name: "bridge", impl: address(new Bridge()), @@ -181,6 +191,11 @@ contract DeployOnL1 is DeployCapability { console2.log("- sharedAddressManager : ", sharedAddressManager); // Deploy Vaults + deployProxy({ + name: "mainnet_erc20_vault", + impl: address(new MainnetERC20Vault()), + data: abi.encodeCall(ERC20Vault.init, (owner, sharedAddressManager)) + }); deployProxy({ name: "erc20_vault", impl: address(new ERC20Vault()), @@ -188,6 +203,11 @@ contract DeployOnL1 is DeployCapability { registerTo: sharedAddressManager }); + deployProxy({ + name: "mainnet_erc721_vault", + impl: address(new MainnetERC721Vault()), + data: abi.encodeCall(ERC721Vault.init, (owner, sharedAddressManager)) + }); deployProxy({ name: "erc721_vault", impl: address(new ERC721Vault()), @@ -195,6 +215,11 @@ contract DeployOnL1 is DeployCapability { registerTo: sharedAddressManager }); + deployProxy({ + name: "mainnet_erc1155_vault", + impl: address(new MainnetERC1155Vault()), + data: abi.encodeCall(ERC1155Vault.init, (owner, sharedAddressManager)) + }); deployProxy({ name: "erc1155_vault", impl: address(new ERC1155Vault()),