From fe084982f9d9d309f756876917cb8ad35ce6e12c Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 25 Sep 2024 02:43:26 +0200 Subject: [PATCH] Deploy diamond to X Layer (#806) * Update configs for xlayer * Deploy to X Layer * verify contracts and update logs * Setup SAFE configuration for xlayer * Add RPC to .env.example * Add XLAYER_ETHERSCAN_API_KEY to .env.example * Remove harcoded verification stuff --- .env.example | 2 + config/amarok.json | 12 +- config/cbridge.json | 9 +- config/dexs.json | 8 +- config/global.json | 5 +- config/networks.json | 11 +- config/stargate.json | 5 +- config/tokenwrapper.json | 3 +- deployments/_deployments_log_file.json | 310 ++++++++++++++++++++++- deployments/xlayer.diamond.json | 75 ++++++ deployments/xlayer.json | 24 ++ foundry.toml | 2 + networks | 1 + script/deploy/_targetState.json | 100 +++++++- script/deploy/safe/add-owners-to-safe.ts | 2 +- script/deploy/safe/config.ts | 2 + script/helperFunctions.sh | 5 +- script/utils/viemScriptHelpers.ts | 1 + 18 files changed, 560 insertions(+), 17 deletions(-) create mode 100644 deployments/xlayer.diamond.json create mode 100644 deployments/xlayer.json diff --git a/.env.example b/.env.example index 3e0e02100..f5f02f9f5 100644 --- a/.env.example +++ b/.env.example @@ -30,6 +30,7 @@ ETH_NODE_URI_ROOTSTOCK=https://rootstock.drpc.org #[pre-commit-checker: not a se ETH_NODE_URI_SEI=https://evm-rpc.sei-apis.com #[pre-commit-checker: not a secret].io ETH_NODE_URI_SCROLL=https://1rpc.io/scroll #[pre-commit-checker: not a secret].io ETH_NODE_URI_TAIKO=https://rpc.taiko.tools #[pre-commit-checker: not a secret].io +ETH_NODE_URI_XLAYER=https://rpc.xlayer.tech #[pre-commit-checker: not a secret].io ETH_NODE_URI_ZKSYNC=https://zksync2-mainnet.zksync #[pre-commit-checker: not a secret].io # Testnet RPCs @@ -68,6 +69,7 @@ POLYGON_ETHERSCAN_API_KEY= POLYGONZKEVM_ETHERSCAN_API_KEY= SCROLL_ETHERSCAN_API_KEY= SEI_ETHERSCAN_API_KEY= +XLAYER_ETHERSCAN_API_KEY= TAIKO_ETHERSCAN_API_KEY= diff --git a/config/amarok.json b/config/amarok.json index bf509728d..fa9dd1408 100644 --- a/config/amarok.json +++ b/config/amarok.json @@ -119,9 +119,7 @@ "chainId": 34443, "connextHandler": "0x7380511493DD4c2f1dD75E9CCe5bD52C787D4B51", "domain": "1836016741", - "tokensToApprove": [ - "0x4200000000000000000000000000000000000006" - ] + "tokensToApprove": ["0x4200000000000000000000000000000000000006"] }, "arbitrum": { "chainId": 42161, @@ -300,5 +298,11 @@ "connextHandler": "0x0000000000000000000000000000000000000000", "domain": "", "tokensToApprove": [] + }, + "xlayer": { + "chainId": 196, + "connextHandler": "0x0000000000000000000000000000000000000000", + "domain": "", + "tokensToApprove": [] } -} \ No newline at end of file +} diff --git a/config/cbridge.json b/config/cbridge.json index 0cd7a1922..46974053c 100644 --- a/config/cbridge.json +++ b/config/cbridge.json @@ -122,6 +122,9 @@ "cBridge": "0xD46F8E428A06789B5884df54E029e738277388D1", "messageBus": "0x9Bb46D5100d2Db4608112026951c9C965b233f4D" }, + "xlayer": { + "cBridge": "0xf5C6825015280CdfD0b56903F9F8B5A2233476F5" + }, "zksync": { "cBridge": "0x54069e96C4247b37C2fbd9559CA99f08CD1CD66c", "messageBus": "0x9a98a376D30f2c9A0A7332715c15D940dE3da0e2", @@ -139,9 +142,7 @@ }, "scroll": { "cBridge": "0x9B36f165baB9ebe611d491180418d8De4b8f3a1f", - "tokensToApprove": [ - "0x5300000000000000000000000000000000000004" - ] + "tokensToApprove": ["0x5300000000000000000000000000000000000004"] }, "goerli": { "cBridge": "0x358234B325EF9eA8115291A8b81b7d33A2Fa762D", @@ -159,4 +160,4 @@ "optimisticKovan": { "cBridge": "0x265B25e22bcd7f10a5bD6E6410F10537Cc7567e8" } -} \ No newline at end of file +} diff --git a/config/dexs.json b/config/dexs.json index 1aa19fe4c..43612e027 100644 --- a/config/dexs.json +++ b/config/dexs.json @@ -675,5 +675,11 @@ "0xaB359008620d9368DD0D67A61D654DcdF095155c", "0xE275759e85e5497A1B07EA65529187FD7E987509", "0x111111125421ca6dc452d289314280a0f8842a65" + ], + "xlayer": [ + "0xC69994fd72824ca98F8a0B1E2ABc954E65a91cf4", + "0x12904D12A84702f9F079E1e393fdAbD313496e97", + "0x833Be894C596b15FAe740C2D522d660084c48B05", + "0x2321F1a63A683a1F3634Dbe1CbA0d657D5F56d54" ] -} \ No newline at end of file +} diff --git a/config/global.json b/config/global.json index 81e0d9950..61639c7f8 100644 --- a/config/global.json +++ b/config/global.json @@ -66,6 +66,7 @@ "scroll": "0xdf61270fDC1A892874Fd3C0143A0A4CBA74F4EF1", "sei": "0xdf61270fDC1A892874Fd3C0143A0A4CBA74F4EF1", "taiko": "0xa89a87986e8ee1Ac8fDaCc5Ac91627010Ec9f772", + "xlayer": "0x3fD21B437b5E0a903A8376D33824F9BA658756C2", "zksync": "0x02f1272aEaCaf7BD8b30278bc2AA381Cc623A744" }, "safeOwners": [ @@ -106,6 +107,7 @@ "scroll": "https://safe-transaction-scroll.safe.global/api", "sei": "https://transaction.sei-safe.protofire.io/api", "taiko": "https://transaction.safe.taiko.xyz/api", + "xlayer": "https://safe-transaction-xlayer.safe.global/api", "zksync": "https://safe-transaction-zksync.safe.global/api" }, "nativeAddress": { @@ -137,6 +139,7 @@ "rootstock": "0x0000000000000000000000000000000000000000", "scroll": "0x0000000000000000000000000000000000000000", "sei": "0x0000000000000000000000000000000000000000", + "xlayer": "0x0000000000000000000000000000000000000000", "taiko": "0x0000000000000000000000000000000000000000", "zksync": "0x0000000000000000000000000000000000000000" }, @@ -146,4 +149,4 @@ "TokenWrapper", "LiFiDEXAggregator" ] -} \ No newline at end of file +} diff --git a/config/networks.json b/config/networks.json index f6222b671..bf6935104 100644 --- a/config/networks.json +++ b/config/networks.json @@ -251,6 +251,15 @@ "status": "active", "type": "mainnet" }, + "xlayer": { + "name": "X Layer", + "chainId": 196, + "nativeAddress": "0x0000000000000000000000000000000000000000", + "nativeCurrency": "OKB", + "wrappedNativeAddress": "0xe538905cf8410324e03a5a23c1c177a474d59b2b", + "status": "active", + "type": "mainnet" + }, "zksync": { "name": "zkSync Era Mainnet", "chainId": 324, @@ -305,4 +314,4 @@ "status": "active", "type": "testnet" } -} \ No newline at end of file +} diff --git a/config/stargate.json b/config/stargate.json index a4e133db0..f79202d0f 100644 --- a/config/stargate.json +++ b/config/stargate.json @@ -35,6 +35,7 @@ "mantle": "0x1a44076050125825900e736c501f859c50fE728c", "scroll": "0x1a44076050125825900e736c501f859c50fE728c", "taiko": "0x1a44076050125825900e736c501f859c50fE728c", + "xlayer": "0x0000000000000000000000000000000000000000", "zksync": "0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF", "sei": "0x1a44076050125825900e736c501f859c50fE728c", "localanvil": "0x0000000000000000000000000000000000000000", @@ -224,6 +225,7 @@ "mode": "0x0000000000000000000000000000000000000000", "mantle": "0x296F55F8Fb28E498B858d0BcDA06D955B2Cb3f97", "scroll": "0x0000000000000000000000000000000000000000", + "xlayer": "0x0000000000000000000000000000000000000000", "taiko": "0x0000000000000000000000000000000000000000", "localanvil": "0x0000000000000000000000000000000000000000", "mumbai": "0x0000000000000000000000000000000000000000", @@ -263,9 +265,10 @@ "mantle": "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590", "metis": "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590", "scroll": "0x36d4686e19c052787D7f24E6913cEbC025714895", + "xlayer": "0x0000000000000000000000000000000000000000", "taiko": "0x0000000000000000000000000000000000000000", "localanvil": "0x0000000000000000000000000000000000000000", "mumbai": "0x817436a076060D158204d955E5403b6Ed0A5fac0", "sepolia": "0x0000000000000000000000000000000000000000" } -} \ No newline at end of file +} diff --git a/config/tokenwrapper.json b/config/tokenwrapper.json index 0821eef37..826697c45 100644 --- a/config/tokenwrapper.json +++ b/config/tokenwrapper.json @@ -40,6 +40,7 @@ "blast": "0x4300000000000000000000000000000000000004", "rootstock": "0x542fda317318ebf1d3deaf76e0b632741a7e677d", "sei": "0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7", + "xlayer": "0xe538905cf8410324e03a5a23c1c177a474d59b2b", "taiko": "0xA51894664A773981C6C112C43ce576f315d5b1B6", "immutablezkevm": "0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d" -} \ No newline at end of file +} diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index e48572e91..01153b7e0 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -683,6 +683,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xD5cf40A2a18b633cfD6A1Ae16d1771596498cF83", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:40:16", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "DiamondLoupeFacet": { @@ -1381,6 +1395,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x1fC021f0B4016B02DcEE7baDe8521937c79957e0", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:40:40", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "OwnershipFacet": { @@ -2078,6 +2106,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x53bC6229e667E37e114Efd0195dc6E1d354aCFB2", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:41:02", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "DexManagerFacet": { @@ -3021,6 +3063,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0xaCDcb85b8446FAAaC9C5C8256B9d475E41BcA16A", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:41:27", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "AccessManagerFacet": { @@ -3687,6 +3743,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xE3540478Cc5093DfB60141d6Df77aff86eAC9544", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:41:50", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "WithdrawFacet": { @@ -4339,6 +4409,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x00715B2297C44d2C2886C51e010BAB4d22F12ead", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:42:13", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "PeripheryRegistryFacet": { @@ -5018,6 +5102,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xfa81d7Ee8a09563634B7E369a21852Ac9533520a", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:42:39", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFiDiamond": { @@ -5679,6 +5777,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:45:23", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000011f11121df7256c40339393b0fb045321022ce44000000000000000000000000d5cf40a2a18b633cfd6a1ae16d1771596498cf83", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFiDiamondImmutable": { @@ -6681,6 +6793,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xA127168c9FF6A851Ea0779DAc8bddE816C477539", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:49:49", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000f5c6825015280cdfd0b56903f9f8b5a2233476f5", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "GenericSwapFacet": { @@ -7362,6 +7488,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x2460bE223c78495d78Fe4d767f36D3F5c5B36dFE", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:43:03", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "HopFacetOptimized": { @@ -8784,6 +8924,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x445f0c0143210a40835A55Fe357D8eadC7A9B899", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:44:16", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "MultichainFacet": { @@ -10636,6 +10790,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x32f9EBAEA88bfE6b965108A2315AC2bE6253cC82", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:50:57", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000011f11121df7256c40339393b0fb045321022ce44", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "Executor": { @@ -11476,6 +11644,20 @@ } ] } + }, + "xlayer": { + "production": { + "2.0.0": [ + { + "ADDRESS": "0x4c2fd9A794ac2337aD7AD547158B68397B6458A7", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:51:40", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000032f9ebaea88bfe6b965108a2315ac2be6253cc82", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "FeeCollector": { @@ -12117,6 +12299,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xC69994fd72824ca98F8a0B1E2ABc954E65a91cf4", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:52:23", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000008647cc950813966142a416d40c382e2c5db73bb", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "Receiver": { @@ -13293,6 +13489,20 @@ } ] } + }, + "xlayer": { + "production": { + "2.0.2": [ + { + "ADDRESS": "0xE33aFf67082eD48A162996670A3FC80AD01C4B5D", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:54:27", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c2fd9a794ac2337ad7ad547158b68397b6458a700000000000000000000000000000000000000000000000000000000000186a0", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "ServiceFeeCollector": { @@ -15700,6 +15910,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.3": [ + { + "ADDRESS": "0xd3c5bb25207D7F4fAE5fd5ed8dbd17330cB8fA4e", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:48:33", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000f5c6825015280cdfd0b56903f9f8b5a2233476f500000000000000000000000011f11121df7256c40339393b0fb045321022ce44", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "AxelarExecutor": { @@ -18789,6 +19013,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.1.0": [ + { + "ADDRESS": "0x3D86672E044b6263883D59DAdE2c837540089D5c", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:44:40", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "CalldataVerificationFacet": { @@ -19455,6 +19693,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.1.1": [ + { + "ADDRESS": "0x7c2003Db4a3E2a9b8D03Fd72b2BF4A9ceC53A625", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:45:02", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFuelFeeCollector": { @@ -20288,6 +20540,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x12904D12A84702f9F079E1e393fdAbD313496e97", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:53:45", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000c71284231a726a18ac85c94d75f9fe17a185beaf", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "AcrossFacetPacked": { @@ -21490,6 +21756,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x833Be894C596b15FAe740C2D522d660084c48B05", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:55:09", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000e538905cf8410324e03a5a23c1c177a474d59b2b", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "GasRebateDistributor": { @@ -22116,6 +22396,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x18Aa6BfBe85659a011e599C8756e4C2243477fFB", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:43:29", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000000000000000000000000000000000000000000000", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "StargateFacetV2": { @@ -22788,6 +23082,20 @@ } ] } + }, + "xlayer": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x2321F1a63A683a1F3634Dbe1CbA0d657D5F56d54", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2024-09-23 17:53:02", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000029dacdf7ccadf4ee67c923b4c22255a4b2494ed7", + "SALT": "", + "VERIFIED": "true" + } + ] + } } } -} \ No newline at end of file +} diff --git a/deployments/xlayer.diamond.json b/deployments/xlayer.diamond.json new file mode 100644 index 000000000..3ac6e3529 --- /dev/null +++ b/deployments/xlayer.diamond.json @@ -0,0 +1,75 @@ +{ + "LiFiDiamond": { + "Facets": { + "0xD5cf40A2a18b633cfD6A1Ae16d1771596498cF83": { + "Name": "DiamondCutFacet", + "Version": "1.0.3" + }, + "0x1fC021f0B4016B02DcEE7baDe8521937c79957e0": { + "Name": "DiamondLoupeFacet", + "Version": "1.0.3" + }, + "0x53bC6229e667E37e114Efd0195dc6E1d354aCFB2": { + "Name": "OwnershipFacet", + "Version": "1.0.3" + }, + "0x00715B2297C44d2C2886C51e010BAB4d22F12ead": { + "Name": "WithdrawFacet", + "Version": "1.0.3" + }, + "0xaCDcb85b8446FAAaC9C5C8256B9d475E41BcA16A": { + "Name": "DexManagerFacet", + "Version": "1.0.3" + }, + "0xE3540478Cc5093DfB60141d6Df77aff86eAC9544": { + "Name": "AccessManagerFacet", + "Version": "1.0.3" + }, + "0xfa81d7Ee8a09563634B7E369a21852Ac9533520a": { + "Name": "PeripheryRegistryFacet", + "Version": "1.0.3" + }, + "0x445f0c0143210a40835A55Fe357D8eadC7A9B899": { + "Name": "LIFuelFacet", + "Version": "1.0.3" + }, + "0x2460bE223c78495d78Fe4d767f36D3F5c5B36dFE": { + "Name": "GenericSwapFacet", + "Version": "1.0.3" + }, + "0x18Aa6BfBe85659a011e599C8756e4C2243477fFB": { + "Name": "GenericSwapFacetV3", + "Version": "1.0.3" + }, + "0x3D86672E044b6263883D59DAdE2c837540089D5c": { + "Name": "StandardizedCallFacet", + "Version": "1.0.3" + }, + "0x7c2003Db4a3E2a9b8D03Fd72b2BF4A9ceC53A625": { + "Name": "CalldataVerificationFacet", + "Version": "1.0.3" + }, + "0xA127168c9FF6A851Ea0779DAc8bddE816C477539": { + "Name": "CBridgeFacet", + "Version": "1.0.3" + }, + "0xd3c5bb25207D7F4fAE5fd5ed8dbd17330cB8fA4e": { + "Name": "CBridgeFacetPacked", + "Version": "1.0.3" + } + }, + "Periphery": { + "ERC20Proxy": "0x32f9EBAEA88bfE6b965108A2315AC2bE6253cC82", + "Executor": "0x4c2fd9A794ac2337aD7AD547158B68397B6458A7", + "FeeCollector": "0xC69994fd72824ca98F8a0B1E2ABc954E65a91cf4", + "Receiver": "0xE33aFf67082eD48A162996670A3FC80AD01C4B5D", + "LiFuelFeeCollector": "0x12904D12A84702f9F079E1e393fdAbD313496e97", + "TokenWrapper": "0x833Be894C596b15FAe740C2D522d660084c48B05", + "LiFiDEXAggregator": "0x2321F1a63A683a1F3634Dbe1CbA0d657D5F56d54", + "GasRebateDistributor": "", + "ReceiverStargateV2": "", + "RelayerCelerIM": "", + "ServiceFeeCollector": "" + } + } +} \ No newline at end of file diff --git a/deployments/xlayer.json b/deployments/xlayer.json new file mode 100644 index 000000000..05217c6a3 --- /dev/null +++ b/deployments/xlayer.json @@ -0,0 +1,24 @@ +{ + "DiamondCutFacet": "0xD5cf40A2a18b633cfD6A1Ae16d1771596498cF83", + "DiamondLoupeFacet": "0x1fC021f0B4016B02DcEE7baDe8521937c79957e0", + "OwnershipFacet": "0x53bC6229e667E37e114Efd0195dc6E1d354aCFB2", + "DexManagerFacet": "0xaCDcb85b8446FAAaC9C5C8256B9d475E41BcA16A", + "AccessManagerFacet": "0xE3540478Cc5093DfB60141d6Df77aff86eAC9544", + "WithdrawFacet": "0x00715B2297C44d2C2886C51e010BAB4d22F12ead", + "PeripheryRegistryFacet": "0xfa81d7Ee8a09563634B7E369a21852Ac9533520a", + "GenericSwapFacet": "0x2460bE223c78495d78Fe4d767f36D3F5c5B36dFE", + "GenericSwapFacetV3": "0x18Aa6BfBe85659a011e599C8756e4C2243477fFB", + "LIFuelFacet": "0x445f0c0143210a40835A55Fe357D8eadC7A9B899", + "CalldataVerificationFacet": "0x7c2003Db4a3E2a9b8D03Fd72b2BF4A9ceC53A625", + "StandardizedCallFacet": "0x3D86672E044b6263883D59DAdE2c837540089D5c", + "LiFiDiamond": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE", + "CBridgeFacet": "0xA127168c9FF6A851Ea0779DAc8bddE816C477539", + "CBridgeFacetPacked": "0xd3c5bb25207D7F4fAE5fd5ed8dbd17330cB8fA4e", + "ERC20Proxy": "0x32f9EBAEA88bfE6b965108A2315AC2bE6253cC82", + "Executor": "0x4c2fd9A794ac2337aD7AD547158B68397B6458A7", + "FeeCollector": "0xC69994fd72824ca98F8a0B1E2ABc954E65a91cf4", + "Receiver": "0xE33aFf67082eD48A162996670A3FC80AD01C4B5D", + "LiFuelFeeCollector": "0x12904D12A84702f9F079E1e393fdAbD313496e97", + "TokenWrapper": "0x833Be894C596b15FAe740C2D522d660084c48B05", + "LiFiDEXAggregator": "0x2321F1a63A683a1F3634Dbe1CbA0d657D5F56d54" +} \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index 87ebb6946..747865f73 100644 --- a/foundry.toml +++ b/foundry.toml @@ -51,6 +51,7 @@ rootstock = "${ETH_NODE_URI_ROOTSTOCK}" sei = "${ETH_NODE_URI_SEI}" taiko = "${ETH_NODE_URI_TAIKO}" velas = "${ETH_NODE_URI_VELAS}" +xlayer = "${ETH_NODE_URI_XLAYER}" zksync = "${ETH_NODE_URI_ZKSYNC}" scroll = "${ETH_NODE_URI_SCROLL}" @@ -92,6 +93,7 @@ polygonzkevm = { key = "${POLYGONZKEVM_ETHERSCAN_API_KEY}", url = "https://api-z scroll = { key = "${SCROLL_ETHERSCAN_API_KEY}", url = "https://api.scrollscan.com/api", chain = "534352" } sei = { key = "${SEI_ETHERSCAN_API_KEY}", url = "https://seitrace.com/pacific-1/api", chain = "1329" } taiko = { key = "${TAIKO_ETHERSCAN_API_KEY}", url = "https://api.taikoscan.io/api", chain = "167000" } +xlayer = { key = "${XLAYER_ETHERSCAN_API_KEY}", url = "https://www.oklink.com/api/v5/explorer/xlayer/api", chain = "196" } #testnets goerli = { key = "${MAINNET_ETHERSCAN_API_KEY}" } diff --git a/networks b/networks index 11ffa353c..612abe91b 100644 --- a/networks +++ b/networks @@ -27,6 +27,7 @@ rootstock scroll sei taiko +xlayer zksync bsc-testnet lineatest diff --git a/script/deploy/_targetState.json b/script/deploy/_targetState.json index b214e6f41..cfff912c3 100644 --- a/script/deploy/_targetState.json +++ b/script/deploy/_targetState.json @@ -2254,5 +2254,103 @@ "ReceiverStargateV2": "1.0.0" } } + }, + "xlayer": { + "production": { + "LiFiDiamond": { + "DiamondCutFacet": "1.0.0", + "DiamondLoupeFacet": "1.0.0", + "OwnershipFacet": "1.0.0", + "DexManagerFacet": "1.0.1", + "AccessManagerFacet": "1.0.0", + "WithdrawFacet": "1.0.0", + "PeripheryRegistryFacet": "1.0.0", + "GenericSwapFacet": "1.0.0", + "GenericSwapFacetV3": "1.0.1", + "LIFuelFacet": "1.0.1", + "CalldataVerificationFacet": "1.1.1", + "StandardizedCallFacet": "1.1.0", + "LiFiDiamond": "1.0.0", + "ERC20Proxy": "1.0.0", + "Executor": "2.0.0", + "FeeCollector": "1.0.0", + "Receiver": "2.0.2", + "LiFuelFeeCollector": "1.0.1", + "TokenWrapper": "1.0.0", + "LiFiDEXAggregator": "1.0.0", + "CBridgeFacet": "1.0.0", + "CBridgeFacetPacked": "1.0.3" + }, + "LiFiDiamondImmutable": { + "DiamondCutFacet": "1.0.0", + "DiamondLoupeFacet": "1.0.0", + "OwnershipFacet": "1.0.0", + "DexManagerFacet": "1.0.1", + "AccessManagerFacet": "1.0.0", + "WithdrawFacet": "1.0.0", + "PeripheryRegistryFacet": "1.0.0", + "GenericSwapFacet": "1.0.0", + "GenericSwapFacetV3": "1.0.1", + "LIFuelFacet": "1.0.1", + "CalldataVerificationFacet": "1.1.1", + "StandardizedCallFacet": "1.1.0", + "LiFiDiamondImmutable": "1.0.0", + "ERC20Proxy": "1.0.0", + "Executor": "2.0.0", + "FeeCollector": "1.0.0", + "Receiver": "2.0.2", + "LiFuelFeeCollector": "1.0.1", + "TokenWrapper": "1.0.0", + "LiFiDEXAggregator": "1.0.0", + "CBridgeFacet": "1.0.0", + "CBridgeFacetPacked": "1.0.3" + } + } + }, + "beratest": { + "production": { + "LiFiDiamond": { + "DiamondCutFacet": "1.0.0", + "DiamondLoupeFacet": "1.0.0", + "OwnershipFacet": "1.0.0", + "DexManagerFacet": "1.0.1", + "AccessManagerFacet": "1.0.0", + "WithdrawFacet": "1.0.0", + "PeripheryRegistryFacet": "1.0.0", + "GenericSwapFacet": "1.0.0", + "GenericSwapFacetV3": "1.0.1", + "LIFuelFacet": "1.0.1", + "CalldataVerificationFacet": "1.1.1", + "StandardizedCallFacet": "1.1.0", + "LiFiDiamond": "1.0.0", + "ERC20Proxy": "1.0.0", + "Executor": "2.0.0", + "FeeCollector": "1.0.0", + "Receiver": "2.0.2", + "LiFuelFeeCollector": "1.0.1", + "LiFiDEXAggregator": "1.0.0" + }, + "LiFiDiamondImmutable": { + "DiamondCutFacet": "1.0.0", + "DiamondLoupeFacet": "1.0.0", + "OwnershipFacet": "1.0.0", + "DexManagerFacet": "1.0.1", + "AccessManagerFacet": "1.0.0", + "WithdrawFacet": "1.0.0", + "PeripheryRegistryFacet": "1.0.0", + "GenericSwapFacet": "1.0.0", + "GenericSwapFacetV3": "1.0.1", + "LIFuelFacet": "1.0.1", + "CalldataVerificationFacet": "1.1.1", + "StandardizedCallFacet": "1.1.0", + "LiFiDiamondImmutable": "1.0.0", + "ERC20Proxy": "1.0.0", + "Executor": "2.0.0", + "FeeCollector": "1.0.0", + "Receiver": "2.0.2", + "LiFuelFeeCollector": "1.0.1", + "LiFiDEXAggregator": "1.0.0" + } + } } -} \ No newline at end of file +} diff --git a/script/deploy/safe/add-owners-to-safe.ts b/script/deploy/safe/add-owners-to-safe.ts index 1db2b99d2..ee6eb1729 100644 --- a/script/deploy/safe/add-owners-to-safe.ts +++ b/script/deploy/safe/add-owners-to-safe.ts @@ -5,7 +5,7 @@ import Safe, { EthersAdapter } from '@safe-global/protocol-kit' import SafeApiKit from '@safe-global/api-kit' import { ethers } from 'ethers6' import { getSafeUtilityContracts, safeAddresses, safeApiUrls } from './config' -import { getViemChainForNetworkName } from '../../../utils/viemScriptHelpers' +import { getViemChainForNetworkName } from '../../utils/viemScriptHelpers' const main = defineCommand({ meta: { diff --git a/script/deploy/safe/config.ts b/script/deploy/safe/config.ts index ba7eae987..104897222 100644 --- a/script/deploy/safe/config.ts +++ b/script/deploy/safe/config.ts @@ -31,6 +31,7 @@ export const safeApiUrls: Record = { scroll: 'https://safe-transaction-scroll.safe.global/api', sei: 'https://transaction.sei-safe.protofire.io/api', taiko: 'https://transaction.safe.taiko.xyz/api', + xlayer: 'https://safe-transaction-xlayer.safe.global/api', zksync: 'https://safe-transaction-zksync.safe.global/api', } @@ -64,6 +65,7 @@ export const safeAddresses: Record = { scroll: '0xdf61270fDC1A892874Fd3C0143A0A4CBA74F4EF1', sei: '0xdf61270fDC1A892874Fd3C0143A0A4CBA74F4EF1', taiko: '0xa89a87986e8ee1Ac8fDaCc5Ac91627010Ec9f772', + xlayer: '0x3fD21B437b5E0a903A8376D33824F9BA658756C2', zksync: '0x02f1272aEaCaf7BD8b30278bc2AA381Cc623A744', } diff --git a/script/helperFunctions.sh b/script/helperFunctions.sh index 9b0453c88..50c7fa0c6 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -1429,7 +1429,6 @@ function verifyContract() { forge verify-contract --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" # TODO: add code that automatically identifies blockscout verification - # forge verify-contract --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --verifier blockscout --verifier-url "https://explorer.immutable.com/api?" else forge verify-contract --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" >/dev/null 2>&1 fi @@ -2948,6 +2947,10 @@ function getChainId() { echo "13371" return 0 ;; + "xlayer") + echo "196" + return 0 + ;; "taiko") echo "167000" return 0 diff --git a/script/utils/viemScriptHelpers.ts b/script/utils/viemScriptHelpers.ts index 470029461..c72cbc078 100644 --- a/script/utils/viemScriptHelpers.ts +++ b/script/utils/viemScriptHelpers.ts @@ -5,6 +5,7 @@ const chainNameMappings: Record = { zksync: 'zkSync', polygonzkevm: 'polygonZkEvm', immutablezkevm: 'immutableZkEvm', + xlayer: 'xLayer', } const chainMap: Record = {}