diff --git a/.github/workflows/diamondEmergencyPause.yml b/.github/workflows/diamondEmergencyPause.yml index 8265ffcbd..980e0b856 100644 --- a/.github/workflows/diamondEmergencyPause.yml +++ b/.github/workflows/diamondEmergencyPause.yml @@ -49,6 +49,7 @@ jobs: ./script/utils/diamondEMERGENCYPauseGitHub.sh env: ETH_NODE_URI_MAINNET: ${{ secrets.ETH_NODE_URI_MAINNET }} + ETH_NODE_URI_ABSTRACT: ${{ secrets.ETH_NODE_URI_ABSTRACT }} ETH_NODE_URI_ARBITRUM: ${{ secrets.ETH_NODE_URI_ARBITRUM }} ETH_NODE_URI_AURORA: ${{ secrets.ETH_NODE_URI_AURORA }} ETH_NODE_URI_AVALANCHE: ${{ secrets.ETH_NODE_URI_AVALANCHE }} diff --git a/config/amarok.json b/config/amarok.json index f8bdb2aa5..884f63562 100644 --- a/config/amarok.json +++ b/config/amarok.json @@ -12,6 +12,12 @@ "0xdac17f958d2ee523a2206206994597c13d831ec7" ] }, + "abstract": { + "chainId": 2741, + "connextHandler": "0x0000000000000000000000000000000000000000", + "domain": "", + "tokensToApprove": [] + }, "optimism": { "chainId": 10, "connextHandler": "0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA", @@ -282,4 +288,4 @@ "domain": "", "tokensToApprove": [] } -} \ No newline at end of file +} diff --git a/config/dexs.json b/config/dexs.json index 013b0a66e..fc51962bb 100644 --- a/config/dexs.json +++ b/config/dexs.json @@ -46,6 +46,11 @@ "0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f", "0xFe837A3530dD566401d35beFCd55582AF7c4dfFC" ], + "abstract": [ + "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", + "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1", + "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF" + ], "arbitrum": [ "0x5215E9fd223BC909083fbdB2860213873046e45d", "0xdFC2983401614118E1F2D5A5FD93C17Fecf8BdC6", @@ -847,7 +852,9 @@ "0xf91bb752490473b8342a3e964e855b9f9a2a668e" ], "avalancheFujiTestnet": [], - "bscTestnet": ["0x1b02da8cb0d097eb8d57a175b88c7d8b47997506"], + "bscTestnet": [ + "0x1b02da8cb0d097eb8d57a175b88c7d8b47997506" + ], "localanvil": [], "mumbai": [ "0x5215E9fd223BC909083fbdB2860213873046e45d", diff --git a/config/global.json b/config/global.json index 8a2946dea..dccbcdd3c 100644 --- a/config/global.json +++ b/config/global.json @@ -113,6 +113,7 @@ }, "nativeAddress": { "mainnet": "0x0000000000000000000000000000000000000000", + "abstract": "0x0000000000000000000000000000000000000000", "arbitrum": "0x0000000000000000000000000000000000000000", "aurora": "0x0000000000000000000000000000000000000000", "avalanche": "0x0000000000000000000000000000000000000000", @@ -152,4 +153,4 @@ "TokenWrapper", "LiFiDEXAggregator" ] -} \ No newline at end of file +} diff --git a/config/networks.json b/config/networks.json index 4b78c3449..2a641b9d5 100644 --- a/config/networks.json +++ b/config/networks.json @@ -17,6 +17,24 @@ "safeWebUrl": "https://app.safe.global/transactions/queue?safe=eth:0x37347dD595C49212C5FC2D95EA10d1085896f51E", "gasZipChainId": 255 }, + "abstract": { + "name": "abstract", + "chainId": 2741, + "nativeAddress": "0x0000000000000000000000000000000000000000", + "nativeCurrency": "ETH", + "wrappedNativeAddress": "0x3439153EB7AF838Ad19d56E1571FBD09333C2809", + "status": "active", + "type": "mainnet", + "rpcUrl": "https://api.raas.matterhosted.dev", + "verificationType": "etherscan", + "explorerUrl": "https://abscan.io", + "explorerApiUrl": "https://api.abscan.io/api", + "multicallAddress": "0xca11bde05977b3631167028862be2a173976ca11", + "safeApiUrl": "https://transaction.multisig-abs.w3us.site/api", + "safeAddress": "abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", + "safeWebUrl": "https://multisig-abs.w3us.site/home?safe=abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", + "gasZipChainId": null + }, "arbitrum": { "name": "arbitrum", "chainId": 42161, @@ -647,4 +665,4 @@ "safeWebUrl": "", "gasZipChainId": 0 } -} \ No newline at end of file +} diff --git a/config/relay.json b/config/relay.json index d8bdd1ac9..d88749923 100644 --- a/config/relay.json +++ b/config/relay.json @@ -3,6 +3,10 @@ "relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934", "relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF" }, + "abstract": { + "relayReceiver": "0x634e831ce6d460c2cd5067af98d6452eb280e374", + "relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF" + }, "optimism": { "relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934", "relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF" @@ -79,4 +83,4 @@ "relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934", "relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF" } -} \ No newline at end of file +} diff --git a/config/stargate.json b/config/stargate.json index 9d1ceb88d..85117cff6 100644 --- a/config/stargate.json +++ b/config/stargate.json @@ -2,6 +2,7 @@ "endpointV2": { "LinkToDeployedToAddresses": "https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts", "mainnet": "0x1a44076050125825900e736c501f859c50fE728c", + "abstract": "0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF", "arbitrum": "0x1a44076050125825900e736c501f859c50fE728c", "aurora": "0x1a44076050125825900e736c501f859c50fE728c", "avalanche": "0x1a44076050125825900e736c501f859c50fE728c", @@ -49,6 +50,7 @@ "mainnet": "0x6d6620eFa72948C5f68A3C8646d58C00d3f4A980", "bsc": "0x6e3d884c96d640526f273c61dfcf08915ebd7e2b", "polygon": "0x6ce9bf8cdab780416ad1fd87b318a077d2f50eac", + "abstract": "0x183D6b82680189bB4dB826F739CdC9527D467B25", "arbitrum": "0x19cfce47ed54a88614648dc3f19a5980097007dd", "fuse": "0x45a01e4e04f14f7a4a6702c74187c5f6222033cd", "mantle": "0x41b491285a4f888f9f636cec8a363ab9770a0aef", @@ -203,6 +205,7 @@ ], "composers": { "mainnet": "0xeCc19E177d24551aA7ed6Bc6FE566eCa726CC8a9", + "abstract": "0x0000000000000000000000000000000000000000", "arbitrum": "0xeCc19E177d24551aA7ed6Bc6FE566eCa726CC8a9", "aurora": "0x0000000000000000000000000000000000000000", "avalanche": "0xeCc19E177d24551aA7ed6Bc6FE566eCa726CC8a9", @@ -288,4 +291,4 @@ "mumbai": "0x817436a076060D158204d955E5403b6Ed0A5fac0", "sepolia": "0x0000000000000000000000000000000000000000" } -} \ No newline at end of file +} diff --git a/config/tokenwrapper.json b/config/tokenwrapper.json index 471e6039a..c9577b07c 100644 --- a/config/tokenwrapper.json +++ b/config/tokenwrapper.json @@ -1,6 +1,7 @@ { "comment": "Note: this file is generated by a backend script, do not change it manually!", "mainnet": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + "abstract": "0x3439153EB7AF838Ad19d56E1571FBD09333C2809", "optimism": "0x4200000000000000000000000000000000000006", "cronos": "0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23", "rootstock": "0x542fda317318ebf1d3deaf76e0b632741a7e677d", @@ -37,4 +38,4 @@ "scroll": "0x5300000000000000000000000000000000000004", "aurora": "0xc9bdeed33cd01541e1eed10f90519d2c06fe3feb", "harmony": "0xcf664087a5bb0237a0bad6742852ec6c8d69a27a" -} \ No newline at end of file +} diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index a3d183b50..1f0787074 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -2133,6 +2133,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x054A2a335812E559A2582ad79a629266F1B475A3", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 10:26:49", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "DexManagerFacet": { @@ -3142,6 +3156,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x5bE192BA156263af2ddc5AF633e91490Ac5828e6", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 10:47:51", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "AccessManagerFacet": { @@ -3850,6 +3878,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xe24756bC0f197AB82660Ec4312987FBB9a8420f5", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 10:58:00", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "WithdrawFacet": { @@ -4544,6 +4586,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x5dD995420b61deBB1071637aa19DEad85347BC53", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 10:35:25", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "PeripheryRegistryFacet": { @@ -5251,6 +5307,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x192C2Efe1A5E38cc65A0a85fe887aE64F6D297E3", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 11:04:19", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFiDiamond": { @@ -5933,6 +6003,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x4f8C9056bb8A3616693a76922FA35d53C056E5b3", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 12:47:12", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000011f1022ca6adef6400e5677528a80d49a069c00c000000000000000000000000a9bd7d5304a24c005d37dc7dfe844464f9ca718c", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFiDiamondImmutable": { @@ -7686,6 +7770,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x67Ae9269BB0363d4d1171eFCB750AAA0D62c0903", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 11:17:56", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "HopFacetOptimized": { @@ -9170,6 +9268,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x195d5CBEe915E364B5Ea0ed9B7578aDA41bF23F3", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 11:10:03", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "MultichainFacet": { @@ -11064,6 +11176,20 @@ } ] } + }, + "abstract": { + "production": { + "1.1.0": [ + { + "ADDRESS": "0x3C2b4f5916AFe9b9e7cA8F5944e776a713035e01", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 14:42:10", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000011f1022ca6adef6400e5677528a80d49a069c00c", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "Executor": { @@ -11946,6 +12072,20 @@ } ] } + }, + "abstract": { + "production": { + "2.1.0": [ + { + "ADDRESS": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 15:39:52", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000003c2b4f5916afe9b9e7ca8f5944e776a713035e0100000000000000000000000008647cc950813966142a416d40c382e2c5db73bb", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "FeeCollector": { @@ -12629,6 +12769,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 15:09:23", + "CONSTRUCTOR_ARGS": "0x00000000000000000000000008647cc950813966142a416d40c382e2c5db73bb", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "Receiver": { @@ -13867,6 +14021,20 @@ } ] } + }, + "abstract": { + "production": { + "2.1.0": [ + { + "ADDRESS": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 16:02:05", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b700000000000000000000000000000000000000000000000000000000000186a0", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "ServiceFeeCollector": { @@ -16299,6 +16467,10 @@ "CONSTRUCTOR_ARGS": "0x0000000000000000000000009b36f165bab9ebe611d491180418d8de4b8f3a1f00000000000000000000000011f1022ca6adef6400e5677528a80d49a069c00c", "SALT": "", "VERIFIED": "true" + } + ] + } + }, "zksync": { "production": { "1.0.0": [ @@ -19467,6 +19639,20 @@ } ] } + }, + "abstract": { + "production": { + "1.1.0": [ + { + "ADDRESS": "0x481e2911229B05CcA1b912f73201D54D87155730", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 13:12:55", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "CalldataVerificationFacet": { @@ -20213,6 +20399,20 @@ } ] } + }, + "abstract": { + "production": { + "1.2.0": [ + { + "ADDRESS": "0x93452E214CF7cE333Ea1c4139FF9ACd81B4399a9", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 13:20:18", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFuelFeeCollector": { @@ -22380,6 +22580,20 @@ } ] } + }, + "abstract": { + "production": { + "1.1.0": [ + { + "ADDRESS": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 15:00:54", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000003439153eb7af838ad19d56e1571fbd09333c2809000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "GasRebateDistributor": { @@ -23076,6 +23290,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x8A942C47151Ee6209c5De84Aa033678eE9663787", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 11:42:24", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000000000000000000000000000000000000000000000", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "StargateFacetV2": { @@ -23494,6 +23722,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 16:14:06", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000183d6b82680189bb4db826f739cdc9527d467b25", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "ReceiverStargateV2": { @@ -23760,6 +24002,20 @@ } ] } + }, + "abstract": { + "production": { + "1.1.0": [ + { + "ADDRESS": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 16:23:29", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b7000000000000000000000000183d6b82680189bb4db826f739cdc9527d467b25000000000000000000000000d07c30af3ff30d96bdc9c6044958230eb797ddbf00000000000000000000000000000000000000000000000000000000000186a0", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "LiFiDEXAggregator": { @@ -24296,6 +24552,20 @@ } ] } + }, + "abstract": { + "production": { + "1.6.0": [ + { + "ADDRESS": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 18:34:27", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000008647cc950813966142a416d40c382e2c5db73bb0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "EmergencyPauseFacet": { @@ -26935,6 +27205,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-14 16:32:35", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "GetGasFacet": { @@ -26983,4 +27267,4 @@ } } } -} \ No newline at end of file +} diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json new file mode 100644 index 000000000..fd5bce4a1 --- /dev/null +++ b/deployments/abstract.diamond.json @@ -0,0 +1,76 @@ +{ + "LiFiDiamond": { + "Facets": { + "0xA9bD7d5304a24c005D37Dc7Dfe844464F9ca718c": { + "Name": "DiamondCutFacet", + "Version": "1.0.0" + }, + "0xABf05526621346D3526abBa79515D3A0182bAe05": { + "Name": "DiamondLoupeFacet", + "Version": "1.0.0" + }, + "0x054A2a335812E559A2582ad79a629266F1B475A3": { + "Name": "OwnershipFacet", + "Version": "1.0.0" + }, + "0x5dD995420b61deBB1071637aa19DEad85347BC53": { + "Name": "WithdrawFacet", + "Version": "1.0.0" + }, + "0x5bE192BA156263af2ddc5AF633e91490Ac5828e6": { + "Name": "DexManagerFacet", + "Version": "1.0.1" + }, + "0xe24756bC0f197AB82660Ec4312987FBB9a8420f5": { + "Name": "AccessManagerFacet", + "Version": "1.0.0" + }, + "0x192C2Efe1A5E38cc65A0a85fe887aE64F6D297E3": { + "Name": "PeripheryRegistryFacet", + "Version": "1.0.0" + }, + "0x195d5CBEe915E364B5Ea0ed9B7578aDA41bF23F3": { + "Name": "LIFuelFacet", + "Version": "1.0.1" + }, + "0x67Ae9269BB0363d4d1171eFCB750AAA0D62c0903": { + "Name": "GenericSwapFacet", + "Version": "1.0.0" + }, + "0x8A942C47151Ee6209c5De84Aa033678eE9663787": { + "Name": "GenericSwapFacetV3", + "Version": "1.0.1" + }, + "0x481e2911229B05CcA1b912f73201D54D87155730": { + "Name": "StandardizedCallFacet", + "Version": "1.1.0" + }, + "0x93452E214CF7cE333Ea1c4139FF9ACd81B4399a9": { + "Name": "CalldataVerificationFacet", + "Version": "1.2.0" + }, + "0xa408554D876FC52533EDFaA8f7D298912f4B905d": { + "Name": "StargateFacetV2", + "Version": "1.0.1" + }, + "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D": { + "Name": "RelayFacet", + "Version": "1.0.0" + } + }, + "Periphery": { + "ERC20Proxy": "0x3C2b4f5916AFe9b9e7cA8F5944e776a713035e01", + "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", + "FeeCollector": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", + "GasZipPeriphery": "", + "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", + "LiFuelFeeCollector": "", + "Permit2Proxy": "", + "ReceiverAcrossV3": "", + "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "RelayerCelerIM": "", + "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1" + } + } +} diff --git a/deployments/abstract.json b/deployments/abstract.json new file mode 100644 index 000000000..16e3109d1 --- /dev/null +++ b/deployments/abstract.json @@ -0,0 +1,24 @@ +{ + "DiamondCutFacet": "0xA9bD7d5304a24c005D37Dc7Dfe844464F9ca718c", + "DiamondLoupeFacet": "0xABf05526621346D3526abBa79515D3A0182bAe05", + "OwnershipFacet": "0x054A2a335812E559A2582ad79a629266F1B475A3", + "WithdrawFacet": "0x5dD995420b61deBB1071637aa19DEad85347BC53", + "DexManagerFacet": "0x5bE192BA156263af2ddc5AF633e91490Ac5828e6", + "AccessManagerFacet": "0xe24756bC0f197AB82660Ec4312987FBB9a8420f5", + "PeripheryRegistryFacet": "0x192C2Efe1A5E38cc65A0a85fe887aE64F6D297E3", + "LIFuelFacet": "0x195d5CBEe915E364B5Ea0ed9B7578aDA41bF23F3", + "GenericSwapFacet": "0x67Ae9269BB0363d4d1171eFCB750AAA0D62c0903", + "GenericSwapFacetV3": "0x8A942C47151Ee6209c5De84Aa033678eE9663787", + "LiFiDiamond": "0x4f8C9056bb8A3616693a76922FA35d53C056E5b3", + "StandardizedCallFacet": "0x481e2911229B05CcA1b912f73201D54D87155730", + "CalldataVerificationFacet": "0x93452E214CF7cE333Ea1c4139FF9ACd81B4399a9", + "ERC20Proxy": "0x3C2b4f5916AFe9b9e7cA8F5944e776a713035e01", + "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1", + "FeeCollector": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", + "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", + "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "StargateFacetV2": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", + "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", + "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF" +} \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index f613dae73..aaae4415b 100644 --- a/foundry.toml +++ b/foundry.toml @@ -24,6 +24,7 @@ script = "script/deploy/zksync" [rpc_endpoints] mainnet = "${ETH_NODE_URI_MAINNET}" +abstract = "${ETH_NODE_URI_ABSTRACT}" arbitrum = "${ETH_NODE_URI_ARBITRUM}" aurora = "${ETH_NODE_URI_AURORA}" avalanche = "${ETH_NODE_URI_AVALANCHE}" @@ -73,6 +74,7 @@ base = "${ETH_NODE_URI_BASE}" [etherscan] mainnet = { key = "${MAINNET_ETHERSCAN_API_KEY}", chain = "1" } +abstract = { key = "${ABSTRACT_ETHERSCAN_API_KEY}", url = "https://api.abscan.org/api", chain = "2741" } arbitrum = { key = "${ARBITRUM_ETHERSCAN_API_KEY}", url = "https://api.arbiscan.io/api", chain = "42161" } aurora = { key = "${AURORA_ETHERSCAN_API_KEY}", url = "https://explorer.mainnet.aurora.dev/api", chain = "1313161554", verifier = "blockscout" } avalanche = { key = "${AVALANCHE_ETHERSCAN_API_KEY}", url = "https://api.snowtrace.io/api", chain = "43114" } diff --git a/networks b/networks index af8e0eedb..2b1189ce6 100644 --- a/networks +++ b/networks @@ -1,4 +1,5 @@ mainnet +abstract arbitrum aurora avalanche diff --git a/script/deploy/_targetState.json b/script/deploy/_targetState.json index 248526c3e..d10cddc56 100644 --- a/script/deploy/_targetState.json +++ b/script/deploy/_targetState.json @@ -24,7 +24,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -39,7 +39,7 @@ "CelerCircleBridgeFacet": "1.0.1", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "GnosisBridgeFacet": "1.0.0", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", @@ -82,7 +82,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -96,7 +96,7 @@ "CelerCircleBridgeFacet": "1.0.1", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", "HopFacetOptimized": "2.0.0", @@ -211,7 +211,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AllBridgeFacet": "2.0.0", "AmarokFacet": "3.0.0", "AmarokFacetPacked": "1.0.0", @@ -219,7 +219,7 @@ "CBridgeFacetPacked": "1.0.3", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "MayanFacet": "1.0.0", "SquidFacet": "1.0.0", "StargateFacet": "2.2.0", @@ -254,11 +254,11 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AmarokFacet": "3.0.0", "AmarokFacetPacked": "1.0.0", "CBridgeFacet": "1.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", "HopFacetOptimized": "2.0.0", @@ -290,11 +290,11 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "CBridgeFacet": "1.0.0", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "SquidFacet": "1.0.0", "StargateFacet": "2.2.0" } @@ -326,14 +326,14 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AllBridgeFacet": "2.0.0", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", "CelerCircleBridgeFacet": "1.0.1", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "MayanFacet": "1.0.0", "SquidFacet": "1.0.0", "StargateFacet": "2.2.0", @@ -369,7 +369,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -383,7 +383,7 @@ "CelerCircleBridgeFacet": "1.0.1", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", "HopFacetOptimized": "2.0.0", @@ -421,7 +421,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -435,7 +435,7 @@ "CelerCircleBridgeFacet": "1.0.1", "RelayerCelerIM": "2.0.0", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", "HopFacetOptimized": "2.0.0", @@ -529,7 +529,8 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "ReceiverStargateV2": "1.0.0" + "StargateFacetV2": "1.0.1", + "ReceiverStargateV2": "1.1.0" } } }, @@ -623,7 +624,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -632,7 +633,7 @@ "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", "CelerIMFacetMutable": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "SymbiosisFacet": "1.0.0" } } @@ -694,12 +695,12 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "ReceiverAcrossV3": "1.0.0", "AmarokFacet": "3.0.0", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "HopFacet": "2.0.0", "HopFacetPacked": "1.0.6", "HopFacetOptimized": "2.0.0", @@ -806,9 +807,9 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AmarokFacet": "3.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "StargateFacet": "2.2.0", "StargateFacetV2": "1.0.1", "ReceiverStargateV2": "1.0.0", @@ -840,7 +841,7 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -848,7 +849,7 @@ "ReceiverAcrossV3": "1.0.0", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "StargateFacet": "2.2.0", "StargateFacetV2": "1.0.1", "ReceiverStargateV2": "1.0.0", @@ -880,14 +881,14 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", "AcrossFacetPackedV3": "1.0.0", "ReceiverAcrossV3": "1.0.0", "AmarokFacet": "3.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "SymbiosisFacet": "1.0.0" } } @@ -979,7 +980,7 @@ "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacet": "2.0.0", "AcrossFacetPacked": "1.0.0", "AcrossFacetV3": "1.0.0", @@ -987,7 +988,7 @@ "ReceiverAcrossV3": "1.0.0", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "SquidFacet": "1.0.0", "SymbiosisFacet": "1.0.0" } @@ -1017,7 +1018,8 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "ReceiverStargateV2": "1.0.0", + "StargateFacetV2": "1.0.1", + "ReceiverStargateV2": "1.1.0", "SymbiosisFacet": "1.0.0" } } @@ -1077,8 +1079,8 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", - "GasZipFacet": "2.0.0", + "GasZipPeriphery": "1.0.1", + "GasZipFacet": "2.0.2", "StargateFacetV2": "1.0.1", "ReceiverStargateV2": "1.0.0", "SymbiosisFacet": "1.0.0" @@ -1109,11 +1111,11 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", "RelayerCelerIM": "2.0.0", - "GasZipFacet": "2.0.0", + "GasZipFacet": "2.0.2", "StargateFacetV2": "1.0.1", "ReceiverStargateV2": "1.0.0", "SymbiosisFacet": "1.0.0" @@ -1346,10 +1348,10 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "CBridgeFacet": "1.0.0", "CBridgeFacetPacked": "1.0.3", - "GasZipFacet": "2.0.0" + "GasZipFacet": "2.0.2" } } }, @@ -1430,11 +1432,11 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacetV3": "1.0.0", "AcrossFacetPackedV3": "1.0.0", "ReceiverAcrossV3": "1.0.0", - "GasZipFacet": "2.0.0" + "GasZipFacet": "2.0.2" } } }, @@ -1462,11 +1464,11 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "GasZipPeriphery": "1.0.0", + "GasZipPeriphery": "1.0.1", "AcrossFacetV3": "1.0.0", "AcrossFacetPackedV3": "1.0.0", "ReceiverAcrossV3": "1.0.0", - "GasZipFacet": "2.0.0" + "GasZipFacet": "2.0.2" } } }, @@ -1494,11 +1496,10 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "AcrossFacetV3": "1.0.0", - "AcrossFacetPackedV3": "1.0.0", - "ReceiverAcrossV3": "1.0.0", + "Permit2Proxy": "1.0.2", + "GasZipFacet": "2.0.2", "StargateFacetV2": "1.0.1", - "ReceiverStargateV2": "1.0.1" + "ReceiverStargateV2": "1.1.0" } } }, @@ -1555,9 +1556,38 @@ "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", - "Permit2Proxy": "1.0.0", - "GasZipPeriphery": "1.0.0", - "GasZipFacet": "2.0.0" + "Permit2Proxy": "1.0.2", + "GasZipPeriphery": "1.0.1", + "GasZipFacet": "2.0.2" + } + } + }, + "sonic": { + "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.2.0", + "StandardizedCallFacet": "1.1.0", + "EmergencyPauseFacet": "1.0.1", + "LiFiDiamond": "1.0.0", + "ERC20Proxy": "1.1.0", + "Executor": "2.1.0", + "FeeCollector": "1.0.1", + "Receiver": "2.1.0", + "LiFuelFeeCollector": "1.0.2", + "TokenWrapper": "1.1.0", + "LiFiDEXAggregator": "1.6.0", + "GasZipPeriphery": "1.0.1", + "GasZipFacet": "2.0.2" } } } diff --git a/script/deploy/deploySingleContract.sh b/script/deploy/deploySingleContract.sh index b7c1e73da..c5b004d10 100755 --- a/script/deploy/deploySingleContract.sh +++ b/script/deploy/deploySingleContract.sh @@ -90,10 +90,10 @@ deploySingleContract() { echo "" fi - # Handle ZkSync + # Handle ZkSync and Abstract # We need to use zksync specific scripts that are able to be compiled for # the zkvm - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then DEPLOY_SCRIPT_DIRECTORY="script/deploy/zksync/" fi @@ -191,7 +191,7 @@ deploySingleContract() { fi fi - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Check if a zksync contract has already been deployed for a specific # version otherwise it might fail since create2 will try to deploy to the # same address @@ -206,10 +206,10 @@ deploySingleContract() { # Clean all old artifacts rm -fr ./out rm -fr ./zkout - # Clean zksync cache + # # Clean zksync cache FOUNDRY_PROFILE=zksync ./foundry-zksync/forge cache clean - - # Run zksync specific fork of forge + # + # # Run zksync specific fork of forge FOUNDRY_PROFILE=zksync ./foundry-zksync/forge build --zksync fi @@ -222,7 +222,7 @@ deploySingleContract() { # ensure that gas price is below maximum threshold (for mainnet only) doNotContinueUnlessGasIsBelowThreshold "$NETWORK" - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Deploy zksync scripts using the zksync specific fork of forge RAW_RETURN_DATA=$(FOUNDRY_PROFILE=zksync DEPLOYSALT=$DEPLOYSALT NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") ./foundry-zksync/forge script "$FULL_SCRIPT_PATH" -f $NETWORK --json --broadcast --skip-simulation --slow --zksync) else diff --git a/script/deploy/zksync/DeployAccessManagerFacet.s.sol b/script/deploy/zksync/DeployAccessManagerFacet.s.sol new file mode 100644 index 000000000..cccaf9852 --- /dev/null +++ b/script/deploy/zksync/DeployAccessManagerFacet.s.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { AccessManagerFacet } from "lifi/Facets/AccessManagerFacet.sol"; + +contract DeployScript is DeployScriptBase { + constructor() DeployScriptBase("AccessManagerFacet") {} + + function run() public returns (AccessManagerFacet deployed) { + deployed = AccessManagerFacet( + deploy(type(AccessManagerFacet).creationCode) + ); + } +} diff --git a/script/deploy/zksync/DeployCalldataVerificationFacet.s.sol b/script/deploy/zksync/DeployCalldataVerificationFacet.s.sol index 729c39b52..9f7a14acd 100644 --- a/script/deploy/zksync/DeployCalldataVerificationFacet.s.sol +++ b/script/deploy/zksync/DeployCalldataVerificationFacet.s.sol @@ -5,7 +5,7 @@ import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; import { CalldataVerificationFacet } from "lifi/Facets/CalldataVerificationFacet.sol"; contract DeployScript is DeployScriptBase { - constructor() DeployScriptBase("CalldataVerificationFacetFacet") {} + constructor() DeployScriptBase("CalldataVerificationFacet") {} function run() public returns (CalldataVerificationFacet deployed) { deployed = CalldataVerificationFacet( diff --git a/script/deploy/zksync/DeployExecutor.s.sol b/script/deploy/zksync/DeployExecutor.s.sol index 525c5166e..d3477c828 100644 --- a/script/deploy/zksync/DeployExecutor.s.sol +++ b/script/deploy/zksync/DeployExecutor.s.sol @@ -32,6 +32,20 @@ contract DeployScript is DeployScriptBase { address erc20Proxy = json.readAddress(".ERC20Proxy"); - return abi.encode(erc20Proxy); + // get path of global config file + string memory globalConfigPath = string.concat( + root, + "/config/global.json" + ); + + // read file into json variable + string memory globalConfigJson = vm.readFile(globalConfigPath); + + // extract withdrawWallet address + address withdrawWalletAddress = globalConfigJson.readAddress( + ".withdrawWallet" + ); + + return abi.encode(erc20Proxy, withdrawWalletAddress); } } diff --git a/script/deploy/zksync/DeployLIFuelFacet.s.sol b/script/deploy/zksync/DeployLIFuelFacet.s.sol new file mode 100644 index 000000000..a7fcd8ee8 --- /dev/null +++ b/script/deploy/zksync/DeployLIFuelFacet.s.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { stdJson } from "forge-std/StdJson.sol"; +import { LIFuelFacet } from "lifi/Facets/LIFuelFacet.sol"; + +contract DeployScript is DeployScriptBase { + using stdJson for string; + + constructor() DeployScriptBase("LIFuelFacet") {} + + function run() + public + returns (LIFuelFacet deployed, bytes memory constructorArgs) + { + constructorArgs = abi.encodePacked(""); + deployed = LIFuelFacet(deploy(type(LIFuelFacet).creationCode)); + } +} diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol index ba89e01c4..d224c5eba 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol @@ -30,6 +30,19 @@ contract DeployScript is DeployScriptBase { // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox - return abi.encode(address(0), priviledgedUsers); + // get path of global config file + string memory globalConfigPath = string.concat( + root, + "/config/global.json" + ); + + // read file into json variable + string memory globalConfigJson = vm.readFile(globalConfigPath); + + // extract withdrawWallet address + address withdrawWalletAddress = globalConfigJson.readAddress( + ".withdrawWallet" + ); + return abi.encode(address(0), priviledgedUsers, withdrawWalletAddress); } } diff --git a/script/deploy/zksync/DeployReceiverStargateV2.s.sol b/script/deploy/zksync/DeployReceiverStargateV2.s.sol new file mode 100644 index 000000000..15f2daca4 --- /dev/null +++ b/script/deploy/zksync/DeployReceiverStargateV2.s.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { stdJson } from "forge-std/Script.sol"; +import { ReceiverStargateV2 } from "lifi/Periphery/ReceiverStargateV2.sol"; + +contract DeployScript is DeployScriptBase { + using stdJson for string; + + constructor() DeployScriptBase("ReceiverStargateV2") {} + + function run() + public + returns (ReceiverStargateV2 deployed, bytes memory constructorArgs) + { + constructorArgs = getConstructorArgs(); + + deployed = ReceiverStargateV2( + deploy(type(ReceiverStargateV2).creationCode) + ); + } + + function getConstructorArgs() internal override returns (bytes memory) { + // get path of global config file + string memory globalConfigPath = string.concat( + root, + "/config/global.json" + ); + + // read file into json variable + string memory globalConfigJson = vm.readFile(globalConfigPath); + + // extract refundWallet address + address refundWalletAddress = globalConfigJson.readAddress( + ".refundWallet" + ); + + // obtain address of LayerZero's EndPointV2 contract in current network from config file + string memory path = string.concat(root, "/config/stargate.json"); + string memory json = vm.readFile(path); + + address endpointV2 = json.readAddress( + string.concat(".endpointV2.", network) + ); + address tokenMessaging = json.readAddress( + string.concat(".tokenMessaging.", network) + ); + + // get Executor address from deploy log + path = string.concat( + root, + "/deployments/", + network, + ".", + fileSuffix, + "json" + ); + json = vm.readFile(path); + address executor = json.readAddress(".Executor"); + + return + abi.encode( + refundWalletAddress, + executor, + tokenMessaging, + endpointV2, + 100000 + ); + } +} diff --git a/script/deploy/zksync/DeployRelayFacet.s_1.sol b/script/deploy/zksync/DeployRelayFacet.s_1.sol new file mode 100644 index 000000000..f1382e220 --- /dev/null +++ b/script/deploy/zksync/DeployRelayFacet.s_1.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { stdJson } from "forge-std/Script.sol"; +import { RelayFacet } from "lifi/Facets/RelayFacet.sol"; + +contract DeployScript is DeployScriptBase { + using stdJson for string; + + constructor() DeployScriptBase("RelayFacet") {} + + function run() + public + returns (RelayFacet deployed, bytes memory constructorArgs) + { + constructorArgs = getConstructorArgs(); + + deployed = RelayFacet(deploy(type(RelayFacet).creationCode)); + } + + function getConstructorArgs() internal override returns (bytes memory) { + string memory path = string.concat(root, "/config/relay.json"); + string memory json = vm.readFile(path); + + address relayReceiver = json.readAddress( + string.concat(".", network, ".relayReceiver") + ); + + address relaySolver = json.readAddress( + string.concat(".", network, ".relaySolver") + ); + + return abi.encode(relayReceiver, relaySolver); + } +} diff --git a/script/deploy/zksync/DeployStandardizedCallFacet.s.sol b/script/deploy/zksync/DeployStandardizedCallFacet.s.sol index 45d75bda6..9fe88f016 100644 --- a/script/deploy/zksync/DeployStandardizedCallFacet.s.sol +++ b/script/deploy/zksync/DeployStandardizedCallFacet.s.sol @@ -5,7 +5,7 @@ import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; import { StandardizedCallFacet } from "lifi/Facets/StandardizedCallFacet.sol"; contract DeployScript is DeployScriptBase { - constructor() DeployScriptBase("StandardizedCallFacetFacet") {} + constructor() DeployScriptBase("StandardizedCallFacet") {} function run() public returns (StandardizedCallFacet deployed) { deployed = StandardizedCallFacet( diff --git a/script/deploy/zksync/DeployStargateFacetV2.s.sol b/script/deploy/zksync/DeployStargateFacetV2.s.sol new file mode 100644 index 000000000..dca898e6c --- /dev/null +++ b/script/deploy/zksync/DeployStargateFacetV2.s.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { stdJson } from "forge-std/Script.sol"; +import { StargateFacetV2 } from "lifi/Facets/StargateFacetV2.sol"; + +contract DeployScript is DeployScriptBase { + using stdJson for string; + + constructor() DeployScriptBase("StargateFacetV2") {} + + function run() + public + returns (StargateFacetV2 deployed, bytes memory constructorArgs) + { + constructorArgs = getConstructorArgs(); + + deployed = StargateFacetV2(deploy(type(StargateFacetV2).creationCode)); + } + + function getConstructorArgs() internal override returns (bytes memory) { + string memory path = string.concat(root, "/config/stargate.json"); + string memory json = vm.readFile(path); + + address tokenMessaging = json.readAddress( + string.concat(".tokenMessaging.", network) + ); + + return abi.encode(tokenMessaging); + } +} diff --git a/script/deploy/zksync/UpdateCoreFacets.s.sol b/script/deploy/zksync/UpdateCoreFacets.s.sol new file mode 100644 index 000000000..a19863189 --- /dev/null +++ b/script/deploy/zksync/UpdateCoreFacets.s.sol @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { UpdateScriptBase, console } from "./utils/UpdateScriptBase.sol"; +import { stdJson } from "forge-std/StdJson.sol"; +import { DiamondCutFacet, IDiamondCut } from "lifi/Facets/DiamondCutFacet.sol"; +import { DiamondLoupeFacet, IDiamondLoupe } from "lifi/Facets/DiamondLoupeFacet.sol"; +import { OwnershipFacet } from "lifi/Facets/OwnershipFacet.sol"; +import { WithdrawFacet } from "lifi/Facets/WithdrawFacet.sol"; +import { DexManagerFacet } from "lifi/Facets/DexManagerFacet.sol"; +import { AccessManagerFacet } from "lifi/Facets/AccessManagerFacet.sol"; +import { PeripheryRegistryFacet } from "lifi/Facets/PeripheryRegistryFacet.sol"; +import { StandardizedCallFacet } from "lifi/Facets/StandardizedCallFacet.sol"; +import { CalldataVerificationFacet } from "lifi/Facets/CalldataVerificationFacet.sol"; + +contract DeployScript is UpdateScriptBase { + using stdJson for string; + + function run() + public + returns (address[] memory facets, bytes memory cutData) + { + address diamondLoupe = json.readAddress(".DiamondLoupeFacet"); + address ownership = json.readAddress(".OwnershipFacet"); + address withdraw = json.readAddress(".WithdrawFacet"); + address dexMgr = json.readAddress(".DexManagerFacet"); + address accessMgr = json.readAddress(".AccessManagerFacet"); + address peripheryRgs = json.readAddress(".PeripheryRegistryFacet"); + address liFuelAddress = json.readAddress(".LIFuelFacet"); + address genSwapAddress = json.readAddress(".GenericSwapFacet"); + address genSwapV3Address = json.readAddress(".GenericSwapFacetV3"); + address standCallAddress = json.readAddress(".StandardizedCallFacet"); + address calldVerifAddress = json.readAddress( + ".CalldataVerificationFacet" + ); + + bytes4[] memory exclude; + + // check if the loupe was already added to the diamond + bool loupeExists; + try loupe.facetAddresses() returns (address[] memory) { + // if call was successful, loupe exists on diamond already + loupeExists = true; + } catch { + // no need to do anything, just making sure that the flow continues in both cases with try/catch + } + + // Diamond Loupe + bytes4[] memory selectors = getSelectors("DiamondLoupeFacet", exclude); + + if (!loupeExists) { + buildInitialCut(selectors, diamondLoupe); + vm.startBroadcast(deployerPrivateKey); + if (cut.length > 0) { + cutter.diamondCut(cut, address(0), ""); + } + vm.stopBroadcast(); + } + + // reset diamond cut variable to remove diamondLoupe information + delete cut; + + // Ownership Facet + selectors = getSelectors("OwnershipFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, ownership); + } else { + buildInitialCut(selectors, ownership); + } + + // Withdraw Facet + selectors = getSelectors("WithdrawFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, withdraw); + } else { + buildInitialCut(selectors, withdraw); + } + + // Dex Manager Facet + selectors = getSelectors("DexManagerFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, dexMgr); + } else { + buildInitialCut(selectors, dexMgr); + } + + // Access Manager Facet + selectors = getSelectors("AccessManagerFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, accessMgr); + } else { + buildInitialCut(selectors, accessMgr); + } + + // PeripheryRegistry + selectors = getSelectors("PeripheryRegistryFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, peripheryRgs); + } else { + buildInitialCut(selectors, peripheryRgs); + } + + // LIFuelFacet + selectors = getSelectors("LIFuelFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, liFuelAddress); + } else { + buildInitialCut(selectors, liFuelAddress); + } + + // GenericSwapFacet + selectors = getSelectors("GenericSwapFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, genSwapAddress); + } else { + buildInitialCut(selectors, genSwapAddress); + } + + // GenericSwapFacetV3 + selectors = getSelectors("GenericSwapFacetV3", exclude); + if (loupeExists) { + buildDiamondCut(selectors, genSwapV3Address); + } else { + buildInitialCut(selectors, genSwapV3Address); + } + + // StandardizedCallFacet + selectors = getSelectors("StandardizedCallFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, standCallAddress); + } else { + buildInitialCut(selectors, standCallAddress); + } + + // CalldataVerificationFacet + selectors = getSelectors("CalldataVerificationFacet", exclude); + if (loupeExists) { + buildDiamondCut(selectors, calldVerifAddress); + } else { + buildInitialCut(selectors, calldVerifAddress); + } + + // if noBroadcast is activated, we only prepare calldata for sending it to multisig SAFE + if (noBroadcast) { + if (cut.length > 0) { + cutData = abi.encodeWithSelector( + DiamondCutFacet.diamondCut.selector, + cut, + address(0), + "" + ); + } + return (facets, cutData); + } + + vm.startBroadcast(deployerPrivateKey); + if (cut.length > 0) { + cutter.diamondCut(cut, address(0), ""); + } + + vm.stopBroadcast(); + + facets = loupe.facetAddresses(); + } +} diff --git a/script/deploy/zksync/utils/UpdateScriptBase.sol b/script/deploy/zksync/utils/UpdateScriptBase.sol new file mode 100644 index 000000000..717f395f5 --- /dev/null +++ b/script/deploy/zksync/utils/UpdateScriptBase.sol @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { ScriptBase, console } from "./ScriptBase.sol"; +import { stdJson } from "forge-std/StdJson.sol"; +import { DiamondCutFacet } from "lifi/Facets/DiamondCutFacet.sol"; +import { DiamondLoupeFacet } from "lifi/Facets/DiamondLoupeFacet.sol"; +import { AccessManagerFacet } from "lifi/Facets/AccessManagerFacet.sol"; +import { LibDiamond } from "lifi/Libraries/LibDiamond.sol"; + +contract UpdateScriptBase is ScriptBase { + using stdJson for string; + + struct FunctionSignature { + string name; + bytes sig; + } + + address internal diamond; + LibDiamond.FacetCut[] internal cut; + bytes4[] internal selectorsToReplace; + bytes4[] internal selectorsToRemove; + bytes4[] internal selectorsToAdd; + DiamondCutFacet internal cutter; + DiamondLoupeFacet internal loupe; + string internal path; + string internal json; + bool internal noBroadcast = false; + bool internal useDefaultDiamond; + + constructor() { + useDefaultDiamond = vm.envBool("USE_DEF_DIAMOND"); + // noBroadcast = vm.envOr("NO_BROADCAST", false); + + path = string.concat( + root, + "/deployments/", + network, + ".", + fileSuffix, + "json" + ); + json = vm.readFile(path); + diamond = useDefaultDiamond + ? json.readAddress(".LiFiDiamond") + : json.readAddress(".LiFiDiamondImmutable"); + cutter = DiamondCutFacet(diamond); + loupe = DiamondLoupeFacet(diamond); + } + + function update( + string memory name + ) + internal + virtual + returns (address[] memory facets, bytes memory cutData) + { + address facet = json.readAddress(string.concat(".", name)); + + bytes4[] memory excludes = getExcludes(); + bytes memory callData = getCallData(); + + buildDiamondCut(getSelectors(name, excludes), facet); + + if (noBroadcast) { + if (cut.length > 0) { + cutData = abi.encodeWithSelector( + DiamondCutFacet.diamondCut.selector, + cut, + callData.length > 0 ? facet : address(0), + callData + ); + } + return (facets, cutData); + } + + vm.startBroadcast(deployerPrivateKey); + + if (cut.length > 0) { + cutter.diamondCut( + cut, + callData.length > 0 ? facet : address(0), + callData + ); + } + + facets = loupe.facetAddresses(); + + vm.stopBroadcast(); + } + + function getExcludes() internal virtual returns (bytes4[] memory) {} + + function getCallData() internal virtual returns (bytes memory) {} + + function getSelectors( + string memory _facetName, + bytes4[] memory _exclude + ) internal returns (bytes4[] memory selectors) { + string[] memory cmd = new string[](3); + cmd[0] = "script/deploy/facets/utils/contract-selectors.sh"; + cmd[1] = _facetName; + string memory exclude; + for (uint256 i; i < _exclude.length; i++) { + exclude = string.concat(exclude, fromCode(_exclude[i]), " "); + } + cmd[2] = exclude; + bytes memory res = vm.ffi(cmd); + selectors = abi.decode(res, (bytes4[])); + } + + function buildDiamondCut( + bytes4[] memory newSelectors, + address newFacet + ) internal { + address oldFacet; + + selectorsToAdd = new bytes4[](0); + selectorsToReplace = new bytes4[](0); + selectorsToRemove = new bytes4[](0); + + // Get selectors to add or replace + for (uint256 i; i < newSelectors.length; i++) { + if (loupe.facetAddress(newSelectors[i]) == address(0)) { + selectorsToAdd.push(newSelectors[i]); + // Don't replace if the new facet address is the same as the old facet address + } else if (loupe.facetAddress(newSelectors[i]) != newFacet) { + selectorsToReplace.push(newSelectors[i]); + oldFacet = loupe.facetAddress(newSelectors[i]); + } + } + + // Get selectors to remove + bytes4[] memory oldSelectors = loupe.facetFunctionSelectors(oldFacet); + for (uint256 i; i < oldSelectors.length; i++) { + bool found = false; + for (uint256 j; j < newSelectors.length; j++) { + if (oldSelectors[i] == newSelectors[j]) { + found = true; + break; + } + } + if (!found) { + selectorsToRemove.push(oldSelectors[i]); + } + } + + // Build diamond cut + if (selectorsToReplace.length > 0) { + cut.push( + LibDiamond.FacetCut({ + facetAddress: newFacet, + action: LibDiamond.FacetCutAction.Replace, + functionSelectors: selectorsToReplace + }) + ); + } + + if (selectorsToRemove.length > 0) { + cut.push( + LibDiamond.FacetCut({ + facetAddress: address(0), + action: LibDiamond.FacetCutAction.Remove, + functionSelectors: selectorsToRemove + }) + ); + } + + if (selectorsToAdd.length > 0) { + cut.push( + LibDiamond.FacetCut({ + facetAddress: newFacet, + action: LibDiamond.FacetCutAction.Add, + functionSelectors: selectorsToAdd + }) + ); + } + } + + function buildInitialCut( + bytes4[] memory newSelectors, + address newFacet + ) internal { + cut.push( + LibDiamond.FacetCut({ + facetAddress: newFacet, + action: LibDiamond.FacetCutAction.Add, + functionSelectors: newSelectors + }) + ); + } + + function toHexDigit(uint8 d) internal pure returns (bytes1) { + if (0 <= d && d <= 9) { + return bytes1(uint8(bytes1("0")) + d); + } else if (10 <= uint8(d) && uint8(d) <= 15) { + return bytes1(uint8(bytes1("a")) + d - 10); + } + revert(); + } + + function fromCode(bytes4 code) public pure returns (string memory) { + bytes memory result = new bytes(10); + result[0] = bytes1("0"); + result[1] = bytes1("x"); + for (uint256 i = 0; i < 4; ++i) { + result[2 * i + 2] = toHexDigit(uint8(code[i]) / 16); + result[2 * i + 3] = toHexDigit(uint8(code[i]) % 16); + } + return string(result); + } + + function approveRefundWallet() internal { + // get refund wallet address from global config file + path = string.concat(root, "/config/global.json"); + json = vm.readFile(path); + address refundWallet = json.readAddress(".refundWallet"); + + // get function signatures that should be approved for refundWallet + bytes memory rawConfig = json.parseRaw(".approvedSigsForRefundWallet"); + + // parse raw data from config into FunctionSignature array + FunctionSignature[] memory funcSigsToBeApproved = abi.decode( + rawConfig, + (FunctionSignature[]) + ); + + // go through array with function signatures + for (uint256 i = 0; i < funcSigsToBeApproved.length; i++) { + // Register refundWallet as authorized wallet to call these functions + AccessManagerFacet(diamond).setCanExecute( + bytes4(funcSigsToBeApproved[i].sig), + refundWallet, + true + ); + } + } + + function approveDeployerWallet() internal { + // get refund wallet address from global config file + path = string.concat(root, "/config/global.json"); + json = vm.readFile(path); + address refundWallet = json.readAddress(".deployerWallet"); + + // get function signatures that should be approved for refundWallet + bytes memory rawConfig = json.parseRaw( + ".approvedSigsForDeployerWallet" + ); + + // parse raw data from config into FunctionSignature array + FunctionSignature[] memory funcSigsToBeApproved = abi.decode( + rawConfig, + (FunctionSignature[]) + ); + + // go through array with function signatures + for (uint256 i = 0; i < funcSigsToBeApproved.length; i++) { + // Register refundWallet as authorized wallet to call these functions + AccessManagerFacet(diamond).setCanExecute( + bytes4(funcSigsToBeApproved[i].sig), + refundWallet, + true + ); + } + } +} diff --git a/script/helperFunctions.sh b/script/helperFunctions.sh index cf04eb762..d29d62184 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -1426,16 +1426,16 @@ function verifyContract() { if [ "$ARGS" = "0x" ]; then # only show output if DEBUG flag is activated if [[ "$DEBUG" == *"true"* ]]; then - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Verify using foundry-zksync - FOUNDRY_PROFILE=zksync ./foundry-zksync/forge verify-contract --zksync --watch --chain 324 "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" + FOUNDRY_PROFILE=zksync ./foundry-zksync/forge verify-contract --zksync --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" else forge verify-contract --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" fi # TODO: add code that automatically identifies blockscout verification else - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Verify using foundry-zksync FOUNDRY_PROFILE=zksync ./foundry-zksync/forge verify-contract --zksync --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --skip-is-verified-check -e "${!API_KEY}" >/dev/null 2>&1 else @@ -1445,14 +1445,14 @@ function verifyContract() { else # only show output if DEBUG flag is activated if [[ "$DEBUG" == *"true"* ]]; then - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Verify using foundry-zksync FOUNDRY_PROFILE=zksync ./foundry-zksync/forge verify-contract --zksync --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --constructor-args $ARGS --skip-is-verified-check -e "${!API_KEY}" else forge verify-contract --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --constructor-args $ARGS --skip-is-verified-check -e "${!API_KEY}" fi else - if [[ $NETWORK == "zksync" ]]; then + if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; then # Verify using foundry-zksync FOUNDRY_PROFILE=zksync ./foundry-zksync/forge verify-contract --zksync --watch --chain "$CHAIN_ID" "$ADDRESS" "$FULL_PATH" --constructor-args $ARGS --skip-is-verified-check -e "${!API_KEY}" >/dev/null 2>&1 else @@ -2807,6 +2807,10 @@ function getChainId() { echo "1" return 0 ;; + "abstract") + echo "2741" + return 0 + ;; "blast") echo "81457" return 0 diff --git a/src/Facets/DeBridgeDlnFacet.sol b/src/Facets/DeBridgeDlnFacet.sol index 8650bad72..c6ac65ea6 100644 --- a/src/Facets/DeBridgeDlnFacet.sol +++ b/src/Facets/DeBridgeDlnFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity ^0.8.17; import { ILiFi } from "../Interfaces/ILiFi.sol"; import { LibDiamond } from "../Libraries/LibDiamond.sol";