From 6b3a1a8517cc320e5793789f1408c716b74a997d Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 19 Jun 2024 15:22:38 +0200 Subject: [PATCH] feat: deploy LZ testnet --- evm/lib/GeneralisedIncentives | 2 +- evm/lib/catalyst-channel-lists | 2 +- evm/script/BaseMultiChainDeployer.s.sol | 2 ++ evm/script/DeployInterfaces.s.sol | 44 ++++++++++-------------- evm/script/DeployRouter.s.sol | 2 +- evm/script/DeployVaults.s.sol | 4 +-- evm/script/config/config_contracts.json | 4 +-- evm/script/config/config_interfaces.json | 18 ++++++++++ evm/script/config/config_tokens.json | 3 ++ evm/script/config/config_vaults.json | 25 ++++++++++++++ 10 files changed, 73 insertions(+), 33 deletions(-) diff --git a/evm/lib/GeneralisedIncentives b/evm/lib/GeneralisedIncentives index 5216c553..634a634f 160000 --- a/evm/lib/GeneralisedIncentives +++ b/evm/lib/GeneralisedIncentives @@ -1 +1 @@ -Subproject commit 5216c5538e1cdade6ee434aa4176d47f9e0b9b46 +Subproject commit 634a634f45fd3c923946023b4c6bf9815bdf0c3a diff --git a/evm/lib/catalyst-channel-lists b/evm/lib/catalyst-channel-lists index b50c75b5..e83bab88 160000 --- a/evm/lib/catalyst-channel-lists +++ b/evm/lib/catalyst-channel-lists @@ -1 +1 @@ -Subproject commit b50c75b5be0412242cb5294f32634ce11e6b9f24 +Subproject commit e83bab882ddab5a5edac2e54fd7e76c60ab081c9 diff --git a/evm/script/BaseMultiChainDeployer.s.sol b/evm/script/BaseMultiChainDeployer.s.sol index 98e6db75..6ad3e8e9 100644 --- a/evm/script/BaseMultiChainDeployer.s.sol +++ b/evm/script/BaseMultiChainDeployer.s.sol @@ -26,6 +26,8 @@ contract MultiChainDeployer is BaseMultiChainDeployer { wrappedGas[chainKey[Chains.OptimismSepolia]] = "WETH"; wrappedGas[chainKey[Chains.BlastTestnet]] = "WETH"; + + wrappedGas["seidevnet"] = "WSEI"; } } diff --git a/evm/script/DeployInterfaces.s.sol b/evm/script/DeployInterfaces.s.sol index 08d5f0c2..edcc6594 100644 --- a/evm/script/DeployInterfaces.s.sol +++ b/evm/script/DeployInterfaces.s.sol @@ -154,68 +154,60 @@ contract DeployInterfaces is MultiChainDeployer { _deploy(availableBridges); } - function _connect_cci(string[] memory bridges) forEachInterface(bridges) internal { - Chains[] memory all_chains = new Chains[](chain_list.length + chain_list_legacy.length); - uint256 i = 0; - for (i = 0; i < chain_list.length; ++i) { - all_chains[i] = chain_list[i]; - } - for (uint256 j = 0; j < chain_list_legacy.length; ++j) { - all_chains[i+j] = chain_list_legacy[j]; - } + function _connect_cci(string[] memory bridges, string[] memory counterpartChains) forEachInterface(bridges) internal { CatalystChainInterface cci = CatalystChainInterface(abi.decode(config_interfaces.parseRaw(string.concat(".", bridgeVersion, ".", currentChainKey, ".interface")), (address))); - for (i = 0; i < all_chains.length; ++i) { - Chains remoteChain = all_chains[i]; - if (keccak256(abi.encodePacked(currentChainKey)) == keccak256(abi.encodePacked(chainKey[remoteChain]))) continue; + for (uint256 i = 0; i < counterpartChains.length; ++i) { + string memory remoteChain = counterpartChains[i]; + if (keccak256(abi.encodePacked(currentChainKey)) == keccak256(abi.encodePacked(remoteChain))) continue; if ( - !vm.keyExists(config_interfaces, string.concat(".", bridgeVersion, ".", chainKey[remoteChain])) + !vm.keyExists(config_interfaces, string.concat(".", bridgeVersion, ".", remoteChain)) ) continue; // Check if there exists a remote deployment. if ( - !vm.keyExists(config_interfaces, string.concat(".", bridgeVersion, ".", chainKey[remoteChain])) + !vm.keyExists(config_interfaces, string.concat(".", bridgeVersion, ".", remoteChain)) ) { console2.log( "no-deployment", bridgeVersion, - chainKey[remoteChain] + remoteChain ); continue; } // Check if the chain identifier expists. if ( - !vm.keyExists(config_chain, string.concat(".", bridgeVersion, ".", currentChainKey, ".", chainKey[remoteChain])) + !vm.keyExists(config_chain, string.concat(".", bridgeVersion, ".", currentChainKey, ".", remoteChain)) ) { console2.log( "no-chainidentifier", currentChainKey, - chainKey[remoteChain] + remoteChain ); continue; } - bytes32 chainIdentifier = abi.decode(config_chain.parseRaw(string.concat(".", bridgeVersion, ".", currentChainKey, ".", chainKey[remoteChain])), (bytes32)); + bytes32 chainIdentifier = abi.decode(config_chain.parseRaw(string.concat(".", bridgeVersion, ".", currentChainKey, ".", remoteChain)), (bytes32)); // check if a connection has already been set. if (keccak256(cci.chainIdentifierToDestinationAddress(chainIdentifier)) != KECCACK_OF_NOTHING) { console2.log( "skipping", currentChainKey, - chainKey[remoteChain] + remoteChain ); continue; } - address remoteInterface = abi.decode(config_interfaces.parseRaw(string.concat(".", bridgeVersion, ".", chainKey[remoteChain], ".interface")), (address)); - address remoteIncentive = abi.decode(config_interfaces.parseRaw(string.concat(".", bridgeVersion, ".", chainKey[remoteChain], ".escrow")), (address)); + address remoteInterface = abi.decode(config_interfaces.parseRaw(string.concat(".", bridgeVersion, ".", remoteChain, ".interface")), (address)); + address remoteIncentive = abi.decode(config_interfaces.parseRaw(string.concat(".", bridgeVersion, ".", remoteChain, ".escrow")), (address)); console2.log( "connecting", currentChainKey, - chainKey[remoteChain] + remoteChain ); cci.connectNewChain( @@ -230,12 +222,12 @@ contract DeployInterfaces is MultiChainDeployer { } } - function connectCCIAll(string[] memory bridges) load_config iter_chains(chain_list) broadcast external { - _connect_cci(bridges); + function connectCCI(string[] calldata bridges, string[] calldata chains) load_config iter_chains_string(chains) broadcast external { + _connect_cci(bridges, chains); } - function connectCCIAllLegacy(string[] memory bridges) load_config iter_chains(chain_list_legacy) broadcast external { - _connect_cci(bridges); + function connectCCI(string[] calldata bridges, string[] calldata localChains, string[] calldata remoteChains) load_config iter_chains_string(localChains) broadcast external { + _connect_cci(bridges, remoteChains); } } diff --git a/evm/script/DeployRouter.s.sol b/evm/script/DeployRouter.s.sol index c5102bcd..7be0fafa 100644 --- a/evm/script/DeployRouter.s.sol +++ b/evm/script/DeployRouter.s.sol @@ -64,7 +64,7 @@ contract DeployRouter is MultiChainDeployer { deployRouter(); } - function deploy() load_config iter_chains(chain_list) broadcast external { + function deploy(string[] calldata chains) load_config iter_chains_string(chains) broadcast external { _deploy(); } diff --git a/evm/script/DeployVaults.s.sol b/evm/script/DeployVaults.s.sol index eb7e57c2..2bc3dcc1 100644 --- a/evm/script/DeployVaults.s.sol +++ b/evm/script/DeployVaults.s.sol @@ -165,7 +165,7 @@ contract DeployVaults is MultiChainDeployer { } } - function deploy() load_config iter_chains(chain_list) broadcast public { + function deploy(string[] calldata chains) load_config iter_chains_string(chains) broadcast public { _deploy(); } @@ -173,7 +173,7 @@ contract DeployVaults is MultiChainDeployer { _deploy(); } - function setConnection() load_config iter_chains(chain_list) broadcast public { + function setConnection(string[] calldata chains) load_config iter_chains_string(chains) broadcast public { _setConnection(); } diff --git a/evm/script/config/config_contracts.json b/evm/script/config/config_contracts.json index 9dc4410e..9b33f375 100644 --- a/evm/script/config/config_contracts.json +++ b/evm/script/config/config_contracts.json @@ -7,8 +7,8 @@ "volatile_template": "0x0000000003b8C9BFeB9351933CFC301Eea92073F" }, "registry": { - "describer": "0xBa75192eb00d8eE0E8F0861aaF82609b57e9682B", - "describer_registry": "0xeFc15d542Db6DE23fAB7daFc8e38BDd266Ff064d", + "describer": "0x3F578971672d5469D28B39ec2b367CbeBF238a11", + "describer_registry": "0x39AcfC1Edd61Eb08fB96523A3b5419B83A603820", "lens": "0x7363003E709EE4Ce16c32D2DEE8B7616d91D51d5" } } \ No newline at end of file diff --git a/evm/script/config/config_interfaces.json b/evm/script/config/config_interfaces.json index da70f061..e63f53c5 100644 --- a/evm/script/config/config_interfaces.json +++ b/evm/script/config/config_interfaces.json @@ -29,6 +29,24 @@ "escrow": "0x9524ACA1fF46fAd177160F0a803189Cb552A3780" } }, + "LayerZero": { + "arbitrumsepolia": { + "interface": "0x971a39ab3fc82a1b5e813946fd8d16Cb363f4907", + "escrow": "0xbA6f62a6539e4Bc11d2A8B1C760b5a1097c6cF6B" + }, + "optimismsepolia": { + "interface": "0x971a39ab3fc82a1b5e813946fd8d16Cb363f4907", + "escrow": "0xbA6f62a6539e4Bc11d2A8B1C760b5a1097c6cF6B" + }, + "basesepolia": { + "interface": "0x971a39ab3fc82a1b5e813946fd8d16Cb363f4907", + "escrow": "0xbA6f62a6539e4Bc11d2A8B1C760b5a1097c6cF6B" + }, + "seidevnet": { + "interface": "0x971a39ab3fc82a1b5e813946fd8d16Cb363f4907", + "escrow": "0xbA6f62a6539e4Bc11d2A8B1C760b5a1097c6cF6B" + } + }, "Polymer": { "basesepolia": { "interface": "0x7d2193429C1ae9BA1b36ffb8d5Ee467B4ce0EFC3", diff --git a/evm/script/config/config_tokens.json b/evm/script/config/config_tokens.json index f713c8c8..4be0840a 100644 --- a/evm/script/config/config_tokens.json +++ b/evm/script/config/config_tokens.json @@ -25,5 +25,8 @@ }, "optimism": { "WETH": "0x4200000000000000000000000000000000000006" + }, + "seidevnet": { + "WSEI": "0x027D2E627209f1cebA52ADc8A5aFE9318459b44B" } } \ No newline at end of file diff --git a/evm/script/config/config_vaults.json b/evm/script/config/config_vaults.json index aa112e7a..73cf08a7 100644 --- a/evm/script/config/config_vaults.json +++ b/evm/script/config/config_vaults.json @@ -35,5 +35,30 @@ "WGAS": 500000000000000000 } } + }, + "LayerZeroSepoliaArbitrumSeidevnet": { + "cci_version": "LayerZero", + "arbitrumsepolia": { + "cci": "0x971a39ab3fc82a1b5e813946fd8d16cb363f4907", + "address": "0x06d4b5289b981933e34af10817f352061bad6353", + "weights": [ + 1 + ], + "fee": 1000000000000000, + "tokens": { + "WGAS": 500000000000000000 + } + }, + "seidevnet": { + "cci": "0x971a39ab3fc82a1b5e813946fd8d16cb363f4907", + "address": "0x06d4b5289b981933e34af10817f352061bad6353", + "weights": [ + 1 + ], + "fee": 1000000000000000, + "tokens": { + "WGAS": 500000000000000000 + } + } } } \ No newline at end of file