From aba775b3cabe6f2bf6dc82de31ea213cd66669ad Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Mon, 13 Jan 2025 17:21:43 +0300 Subject: [PATCH 01/26] begin configuring abstract --- config/networks.json | 20 +++++++++++++++++++- foundry.toml | 2 ++ networks | 1 + script/deploy/deploySingleContract.sh | 8 ++++---- script/helperFunctions.sh | 10 +++++----- src/Facets/DeBridgeDlnFacet.sol | 2 +- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/config/networks.json b/config/networks.json index 4b78c3449..fd7e81264 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://safe-transaction-abstract.safe.global/api", + "safeAddress": "0x9e606d0d2BbA344b911e2F4Eab95d9235A83fe15", + "safeWebUrl": "https://app.safe.global/home?chain=oeth&safe=arb1:0x9e606d0d2BbA344b911e2F4Eab95d9235A83fe15", + "gasZipChainId": 57 + }, "arbitrum": { "name": "arbitrum", "chainId": 42161, @@ -647,4 +665,4 @@ "safeWebUrl": "", "gasZipChainId": 0 } -} \ 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/deploySingleContract.sh b/script/deploy/deploySingleContract.sh index b7c1e73da..92e123bad 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 @@ -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/helperFunctions.sh b/script/helperFunctions.sh index cf04eb762..0e5379616 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 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"; From 1dbde1002d8d11ad169bb680ed49cbcdcbfd5e05 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 14 Jan 2025 13:53:55 +0300 Subject: [PATCH 02/26] deploy core facets to abstract --- config/global.json | 3 +- config/tokenwrapper.json | 3 +- deployments/_deployments_log_file.json | 160 ++++++++++- deployments/abstract.json | 15 + script/deploy/deploySingleContract.sh | 6 +- .../zksync/DeployAccessManagerFacet.s.sol | 15 + .../DeployCalldataVerificationFacet.s.sol | 2 +- script/deploy/zksync/DeployLIFuelFacet.s.sol | 20 ++ .../zksync/DeployStandardizedCallFacet.s.sol | 2 +- script/deploy/zksync/UpdateCoreFacets.s.sol | 165 +++++++++++ .../deploy/zksync/utils/UpdateScriptBase.sol | 266 ++++++++++++++++++ script/helperFunctions.sh | 4 + 12 files changed, 653 insertions(+), 8 deletions(-) create mode 100644 deployments/abstract.json create mode 100644 script/deploy/zksync/DeployAccessManagerFacet.s.sol create mode 100644 script/deploy/zksync/DeployLIFuelFacet.s.sol create mode 100644 script/deploy/zksync/UpdateCoreFacets.s.sol create mode 100644 script/deploy/zksync/utils/UpdateScriptBase.sol 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/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..0fb80299f 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": { @@ -16299,6 +16411,10 @@ "CONSTRUCTOR_ARGS": "0x0000000000000000000000009b36f165bab9ebe611d491180418d8de4b8f3a1f00000000000000000000000011f1022ca6adef6400e5677528a80d49a069c00c", "SALT": "", "VERIFIED": "true" + } + ] + } + }, "zksync": { "production": { "1.0.0": [ @@ -19467,6 +19583,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 +20343,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": { @@ -23076,6 +23220,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": { @@ -26983,4 +27141,4 @@ } } } -} \ No newline at end of file +} diff --git a/deployments/abstract.json b/deployments/abstract.json new file mode 100644 index 000000000..d7efeeaa5 --- /dev/null +++ b/deployments/abstract.json @@ -0,0 +1,15 @@ +{ + "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" +} \ No newline at end of file diff --git a/script/deploy/deploySingleContract.sh b/script/deploy/deploySingleContract.sh index 92e123bad..c5b004d10 100755 --- a/script/deploy/deploySingleContract.sh +++ b/script/deploy/deploySingleContract.sh @@ -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 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/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/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/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 0e5379616..d29d62184 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -2807,6 +2807,10 @@ function getChainId() { echo "1" return 0 ;; + "abstract") + echo "2741" + return 0 + ;; "blast") echo "81457" return 0 From 5d56ea36c55aa733eae9eab0f8bf3dddf3a36a03 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 14 Jan 2025 16:07:09 +0300 Subject: [PATCH 03/26] more deployments --- config/amarok.json | 8 ++- config/networks.json | 8 +-- config/stargate.json | 5 +- deployments/_deployments_log_file.json | 70 +++++++++++++++++++++++ deployments/abstract.json | 7 ++- script/deploy/zksync/DeployExecutor.s.sol | 16 +++++- 6 files changed, 106 insertions(+), 8 deletions(-) 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/networks.json b/config/networks.json index fd7e81264..2a641b9d5 100644 --- a/config/networks.json +++ b/config/networks.json @@ -30,10 +30,10 @@ "explorerUrl": "https://abscan.io", "explorerApiUrl": "https://api.abscan.io/api", "multicallAddress": "0xca11bde05977b3631167028862be2a173976ca11", - "safeApiUrl": "https://safe-transaction-abstract.safe.global/api", - "safeAddress": "0x9e606d0d2BbA344b911e2F4Eab95d9235A83fe15", - "safeWebUrl": "https://app.safe.global/home?chain=oeth&safe=arb1:0x9e606d0d2BbA344b911e2F4Eab95d9235A83fe15", - "gasZipChainId": 57 + "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", 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/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 0fb80299f..a822f019c 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -11176,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": { @@ -12058,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": { @@ -12741,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": { @@ -13979,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": { @@ -22524,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": { diff --git a/deployments/abstract.json b/deployments/abstract.json index d7efeeaa5..b9daac3b2 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -11,5 +11,10 @@ "GenericSwapFacetV3": "0x8A942C47151Ee6209c5De84Aa033678eE9663787", "LiFiDiamond": "0x4f8C9056bb8A3616693a76922FA35d53C056E5b3", "StandardizedCallFacet": "0x481e2911229B05CcA1b912f73201D54D87155730", - "CalldataVerificationFacet": "0x93452E214CF7cE333Ea1c4139FF9ACd81B4399a9" + "CalldataVerificationFacet": "0x93452E214CF7cE333Ea1c4139FF9ACd81B4399a9", + "ERC20Proxy": "0x3C2b4f5916AFe9b9e7cA8F5944e776a713035e01", + "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1", + "FeeCollector": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", + "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", + "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A" } \ No newline at end of file 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); } } From 0388431807411ecf452daa83bdf6a8bc91c9c3f5 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 14 Jan 2025 16:42:34 +0300 Subject: [PATCH 04/26] more deployments and log updpates --- config/relay.json | 6 +- deployments/_deployments_log_file.json | 42 ++++++ deployments/abstract.json | 5 +- script/deploy/_targetState.json | 124 +++++++++++------- .../zksync/DeployReceiverStargateV2.s.sol | 71 ++++++++++ script/deploy/zksync/DeployRelayFacet.s_1.sol | 36 +++++ .../deploy/zksync/DeployStargateFacetV2.s.sol | 32 +++++ 7 files changed, 267 insertions(+), 49 deletions(-) create mode 100644 script/deploy/zksync/DeployReceiverStargateV2.s.sol create mode 100644 script/deploy/zksync/DeployRelayFacet.s_1.sol create mode 100644 script/deploy/zksync/DeployStargateFacetV2.s.sol 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/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index a822f019c..e692523d7 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -23722,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": { @@ -23988,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": { @@ -27163,6 +27191,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": { diff --git a/deployments/abstract.json b/deployments/abstract.json index b9daac3b2..9c146ad59 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -16,5 +16,8 @@ "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1", "FeeCollector": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", - "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A" + "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "StargateFacetV2": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", + "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D" } \ No newline at end of file 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/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/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); + } +} From b8f24d6b96900f2496609939737a1af055b1d9e0 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 14 Jan 2025 16:51:14 +0300 Subject: [PATCH 05/26] update diamondPause workflow --- .github/workflows/diamondEmergencyPause.yml | 1 + 1 file changed, 1 insertion(+) 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 }} From 676a887f3e3ca841903dea56d08ebb6d0f2e3f3d Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 14 Jan 2025 18:41:51 +0300 Subject: [PATCH 06/26] more deployments update logs --- config/dexs.json | 9 ++- deployments/_deployments_log_file.json | 14 ++++ deployments/abstract.diamond.json | 76 +++++++++++++++++++ deployments/abstract.json | 3 +- .../zksync/DeployLiFiDEXAggregator.s.sol | 15 +++- 5 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 deployments/abstract.diamond.json 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/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index e692523d7..1f0787074 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -24552,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": { 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 index 9c146ad59..16e3109d1 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -19,5 +19,6 @@ "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", "StargateFacetV2": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", - "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D" + "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", + "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF" } \ No newline at end of file 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); } } From f3607a18bcd3fcc4f0135b09bab20f32298e1644 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 16 Jan 2025 13:40:15 +0300 Subject: [PATCH 07/26] gaszip updates --- config/gaszip.json | 3 ++- config/networks.json | 6 +++--- deployments/_deployments_log_file.json | 28 ++++++++++++++++++++++++++ deployments/abstract.diamond.json | 6 +++++- deployments/abstract.json | 4 +++- script/deploy/safe/config.ts | 3 +++ 6 files changed, 44 insertions(+), 6 deletions(-) diff --git a/config/gaszip.json b/config/gaszip.json index f4142d294..5e0098879 100644 --- a/config/gaszip.json +++ b/config/gaszip.json @@ -2,6 +2,7 @@ "gasZipRouters": { "---ListOfRouterAddresses---": "https://dev.gas.zip/gas/chain-support/inbound", "mainnet": "0x2a37D63EAdFe4b4682a3c28C1c2cD4F109Cc2762", + "abstract": "0x252fb662e4D7435D2a5DED8EC94d8932CF76C178", "arbitrum": "0x2a37D63EAdFe4b4682a3c28C1c2cD4F109Cc2762", "avalanche": "0x2a37D63EAdFe4b4682a3c28C1c2cD4F109Cc2762", "base": "0x2a37D63EAdFe4b4682a3c28C1c2cD4F109Cc2762", @@ -23,4 +24,4 @@ "xlayer": "0x2a37D63EAdFe4b4682a3c28C1c2cD4F109Cc2762", "zksync": "0x252fb662e4d7435d2a5ded8ec94d8932cf76c178" } -} \ No newline at end of file +} diff --git a/config/networks.json b/config/networks.json index 2a641b9d5..14c8353a4 100644 --- a/config/networks.json +++ b/config/networks.json @@ -29,11 +29,11 @@ "verificationType": "etherscan", "explorerUrl": "https://abscan.io", "explorerApiUrl": "https://api.abscan.io/api", - "multicallAddress": "0xca11bde05977b3631167028862be2a173976ca11", + "multicallAddress": "0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7", "safeApiUrl": "https://transaction.multisig-abs.w3us.site/api", - "safeAddress": "abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", + "safeAddress": "0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", "safeWebUrl": "https://multisig-abs.w3us.site/home?safe=abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", - "gasZipChainId": null + "gasZipChainId": 110 }, "arbitrum": { "name": "arbitrum", diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 1f0787074..6d48682d3 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -26579,6 +26579,20 @@ } ] } + }, + "abstract": { + "production": { + "2.0.2": [ + { + "ADDRESS": "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-15 18:06:22", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000252fb662e4d7435d2a5ded8ec94d8932cf76c178", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "GasZipPeriphery": { @@ -26887,6 +26901,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0x2A3e04627E554b57163C078fd1d6698A655aeA12", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-15 18:14:27", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000252fb662e4d7435d2a5ded8ec94d8932cf76c178000000000000000000000000fc863e1418c0c5935e7bd9c8f3129aa0442153df000000000000000000000000257cbcdc7fcba79a83149c9d7160ef15a86fa39c", + "SALT": "", + "VERIFIED": "true" + } + ] + } } }, "RelayFacet": { diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json index fd5bce4a1..7e4aa5575 100644 --- a/deployments/abstract.diamond.json +++ b/deployments/abstract.diamond.json @@ -56,13 +56,17 @@ "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D": { "Name": "RelayFacet", "Version": "1.0.0" + }, + "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE": { + "Name": "GasZipFacet", + "Version": "2.0.2" } }, "Periphery": { "ERC20Proxy": "0x3C2b4f5916AFe9b9e7cA8F5944e776a713035e01", "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", "FeeCollector": "0xde6A2171959d7b82aAD8e8B14cc84684C3a186AC", - "GasZipPeriphery": "", + "GasZipPeriphery": "0x2A3e04627E554b57163C078fd1d6698A655aeA12", "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "LiFuelFeeCollector": "", "Permit2Proxy": "", diff --git a/deployments/abstract.json b/deployments/abstract.json index 16e3109d1..70c2822be 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -20,5 +20,7 @@ "StargateFacetV2": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", - "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF" + "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", + "GasZipFacet": "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE", + "GasZipPeriphery": "0x2A3e04627E554b57163C078fd1d6698A655aeA12" } \ No newline at end of file diff --git a/script/deploy/safe/config.ts b/script/deploy/safe/config.ts index 4cd557907..faa55d384 100644 --- a/script/deploy/safe/config.ts +++ b/script/deploy/safe/config.ts @@ -2,6 +2,7 @@ import { ContractNetworksConfig } from '@safe-global/protocol-kit' export const safeApiUrls: Record = { mainnet: 'https://safe-transaction-mainnet.safe.global/api', + abstract: 'https://transaction.multisig-abs.w3us.site/api', arbitrum: 'https://safe-transaction-arbitrum.safe.global/api', aurora: 'https://safe-transaction-aurora.safe.global/api', avalanche: 'https://safe-transaction-avalanche.safe.global/api', @@ -38,6 +39,7 @@ export const safeApiUrls: Record = { export const safeAddresses: Record = { mainnet: '0x37347dD595C49212C5FC2D95EA10d1085896f51E', arbitrum: '0x9e606d0d2BbA344b911e2F4Eab95d9235A83fe15', + abstract: '0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c', aurora: '0xC7291F249424A35b17976F057D2C97B30c92b88C', avalanche: '0x27d4eb2854d93a1A7Df8e2aeD1a535b080a6f6e4', base: '0x1F6974C11B833Eb52ea07E0B442510165D87d82e', @@ -93,6 +95,7 @@ export const getSafeUtilityContracts = (chainId: number) => { } break case 324: + case 2741: // zkSync contractNetworks = { [chainId.toString()]: { From f26dff68c9801acd036c51c0f0431dd52bbc5a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Tue, 28 Jan 2025 10:48:19 +0700 Subject: [PATCH 08/26] replaced ts-node with tsx --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 89cfb181b..d46e9b0f1 100644 --- a/package.json +++ b/package.json @@ -64,15 +64,15 @@ "test": "forge test --evm-version 'shanghai'", "test:fix": "npm run lint:fix; npm run format:fix; npm run test", "gas": "forge snapshot --match-path 'test/solidity/Gas/**/*' -vvv", - "coverage": "rm -rf coverage && rm -f lcov-filtered.info && rm -f lcov.info && forge coverage --report lcov --evm-version 'shanghai' --ir-minimum && ts-node script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/' && genhtml lcov-filtered.info --branch-coverage --output-dir coverage && open coverage/index.html", + "coverage": "rm -rf coverage && rm -f lcov-filtered.info && rm -f lcov.info && forge coverage --report lcov --evm-version 'shanghai' --ir-minimum && tsx script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/' && genhtml lcov-filtered.info --branch-coverage --output-dir coverage && open coverage/index.html", "execute": "node ./_scripts.js run", "abi:generate": "forge clean && rm -fr typechain/* && forge build --skip script --skip test --skip Base --skip Test && tsx tasks/generateDiamondABI.ts", "typechain": "forge clean && rm -rf typechain/* && forge build src && typechain --target ethers-v5 'out/*.sol/*.json' --out-dir typechain", "codegen": "plop", "healthcheck": "tsx ./script/deploy/healthCheck.ts", - "propose-safe-tx": "ts-node ./script/deploy/safe/propose-to-safe.ts", - "confirm-safe-tx": "ts-node ./script/deploy/safe/confirm-safe-tx.ts", - "add-safe-owners": "ts-node ./script/deploy/safe/add-owners-to-safe.ts", + "propose-safe-tx": "tsx ./script/deploy/safe/propose-to-safe.ts", + "confirm-safe-tx": "tsx ./script/deploy/safe/confirm-safe-tx.ts", + "add-safe-owners": "tsx ./script/deploy/safe/add-owners-to-safe.ts", "flatten": "forge flatten --output" }, "dependencies": { From 162d469cb0e6d49d56cba5b5f48113c0815f4359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Tue, 28 Jan 2025 12:18:21 +0700 Subject: [PATCH 09/26] fix imports and add pre-selected action (=sign) when running with SAFE_SIGNER_PRIVATE_KEY --- script/deploy/safe/add-owners-to-safe.ts | 5 +-- script/deploy/safe/confirm-safe-tx.ts | 39 ++++++++++++++++++------ tsconfig.json | 1 + 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/script/deploy/safe/add-owners-to-safe.ts b/script/deploy/safe/add-owners-to-safe.ts index 9d6e1dc28..ea30f2c29 100644 --- a/script/deploy/safe/add-owners-to-safe.ts +++ b/script/deploy/safe/add-owners-to-safe.ts @@ -1,8 +1,9 @@ import { defineCommand, runMain } from 'citty' import { type SafeApiKitConfig } from '@safe-global/api-kit' import { getAddress } from 'viem' -import Safe, { EthersAdapter } from '@safe-global/protocol-kit' -import SafeApiKit from '@safe-global/api-kit' +import { EthersAdapter } from '@safe-global/protocol-kit' +const { default: SafeApiKit } = await import('@safe-global/api-kit') +const { default: Safe } = await import('@safe-global/protocol-kit') import { ethers } from 'ethers6' import { getSafeUtilityContracts } from './config' import { diff --git a/script/deploy/safe/confirm-safe-tx.ts b/script/deploy/safe/confirm-safe-tx.ts index 7018c20fe..b41422bea 100644 --- a/script/deploy/safe/confirm-safe-tx.ts +++ b/script/deploy/safe/confirm-safe-tx.ts @@ -1,8 +1,9 @@ import { defineCommand, runMain } from 'citty' import { type SafeApiKitConfig } from '@safe-global/api-kit' import { Abi, Chain, Hex, decodeFunctionData, parseAbi } from 'viem' -import Safe, { EthersAdapter } from '@safe-global/protocol-kit' -import SafeApiKit from '@safe-global/api-kit' +import { EthersAdapter } from '@safe-global/protocol-kit' +const { default: SafeApiKit } = await import('@safe-global/api-kit') +const { default: Safe } = await import('@safe-global/protocol-kit') import { ethers } from 'ethers6' import consola from 'consola' import * as chains from 'viem/chains' @@ -17,6 +18,11 @@ import { SafeMultisigTransactionResponse } from '@safe-global/safe-core-sdk-type import networksConfig from '../../../config/networks.json' dotenv.config() +enum privateKeyType { + SAFE_SIGNER, + DEPLOYER, +} + const networks: NetworksObject = networksConfig const ABI_LOOKUP_URL = `https://api.openchain.xyz/signature-database/v1/lookup?function=%SELECTOR%&filter=true` @@ -93,7 +99,12 @@ for (const [k, v] of Object.entries(chains)) { chainMap[k] = v } -const func = async (network: string, privateKey: string, rpcUrl?: string) => { +const func = async ( + network: string, + privateKey: string, + privKeyType: privateKeyType, + rpcUrl?: string +) => { console.info(' ') consola.info('-'.repeat(80)) @@ -274,12 +285,15 @@ const func = async (network: string, privateKey: string, rpcUrl?: string) => { continue } + // if this script is run with the SAFE_SIGNER_PRIVATE_KEY then execution is never an option so we can blindly select the SIGN action here const action = - storedResponse ?? - (await consola.prompt('Action', { - type: 'select', - options: ['Sign & Execute Now', 'Sign', 'Execute Now'], - })) + privKeyType == privateKeyType.SAFE_SIGNER + ? 'Sign' + : storedResponse ?? + (await consola.prompt('Action', { + type: 'select', + options: ['Sign & Execute Now', 'Sign', 'Execute Now'], + })) storedResponses[tx.data!] = action const txToConfirm = await retry(() => @@ -361,7 +375,14 @@ const main = defineCommand({ } for (const network of networks) { - await func(network, privateKey, args.rpcUrl) + await func( + network, + privateKey, + privateKey == 'PRIVATE_KEY_PRODUCTION' + ? privateKeyType.DEPLOYER + : privateKeyType.SAFE_SIGNER, + args.rpcUrl + ) } }, }) diff --git a/tsconfig.json b/tsconfig.json index 32f86e9e1..56f71a181 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "module": "ESNext", "strict": true, "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "moduleResolution": "node", "forceConsistentCasingInFileNames": true, "outDir": "dist", From 5a7a6035ed95907c8c366c6a6e31a23d6c49cca3 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 12:39:24 +0300 Subject: [PATCH 10/26] redeploy ReceiverStargateV2 --- config/stargate.json | 2 +- deployments/_deployments_log_file.json | 8 +-- deployments/abstract.diamond.json | 2 +- deployments/abstract.json | 2 +- package.json | 4 +- yarn.lock | 84 +++++++++++++++++--------- 6 files changed, 66 insertions(+), 36 deletions(-) diff --git a/config/stargate.json b/config/stargate.json index 85117cff6..9b59b6490 100644 --- a/config/stargate.json +++ b/config/stargate.json @@ -2,7 +2,7 @@ "endpointV2": { "LinkToDeployedToAddresses": "https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts", "mainnet": "0x1a44076050125825900e736c501f859c50fE728c", - "abstract": "0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF", + "abstract": "0x5c6cfF4b7C49805F8295Ff73C204ac83f3bC4AE7", "arbitrum": "0x1a44076050125825900e736c501f859c50fE728c", "aurora": "0x1a44076050125825900e736c501f859c50fE728c", "avalanche": "0x1a44076050125825900e736c501f859c50fE728c", diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 6d48682d3..a9f35c896 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -24007,11 +24007,11 @@ "production": { "1.1.0": [ { - "ADDRESS": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "ADDRESS": "0x83D2B4f5834d7aDE97E5837781ecfC99D9Cbe004", "OPTIMIZER_RUNS": "1000000", - "TIMESTAMP": "2025-01-14 16:23:29", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b7000000000000000000000000183d6b82680189bb4db826f739cdc9527d467b25000000000000000000000000d07c30af3ff30d96bdc9c6044958230eb797ddbf00000000000000000000000000000000000000000000000000000000000186a0", - "SALT": "", + "TIMESTAMP": "2025-01-28 11:44:12", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b7000000000000000000000000183d6b82680189bb4db826f739cdc9527d467b250000000000000000000000005c6cff4b7c49805f8295ff73c204ac83f3bc4ae700000000000000000000000000000000000000000000000000000000000186a0", + "SALT": "28012025", "VERIFIED": "true" } ] diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json index 7e4aa5575..69ddb4333 100644 --- a/deployments/abstract.diamond.json +++ b/deployments/abstract.diamond.json @@ -77,4 +77,4 @@ "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1" } } -} +} \ No newline at end of file diff --git a/deployments/abstract.json b/deployments/abstract.json index 70c2822be..bff7c26cf 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -18,7 +18,7 @@ "Executor": "0xbA3274Ff65466bDC217745dC276394da4Ffe02b7", "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", "StargateFacetV2": "0xa408554D876FC52533EDFaA8f7D298912f4B905d", - "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "ReceiverStargateV2": "0x83D2B4f5834d7aDE97E5837781ecfC99D9Cbe004", "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "GasZipFacet": "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE", diff --git a/package.json b/package.json index 51cc55fde..039903301 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "notify-send": "^0.1.2", "pino": "^7.9.2", "tsx": "^4.19.2", - "viem": "^2.21.48", + "viem": "^2.22.16", "zx": "^8.2.2" }, "lint-staged": { @@ -123,4 +123,4 @@ "solhint --fix" ] } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index ad11c3f94..573c84f58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -901,7 +901,14 @@ dependencies: "@noble/hashes" "1.3.3" -"@noble/curves@1.6.0", "@noble/curves@^1.4.0", "@noble/curves@^1.6.0", "@noble/curves@~1.6.0": +"@noble/curves@1.8.1", "@noble/curves@~1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" + integrity sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ== + dependencies: + "@noble/hashes" "1.7.1" + +"@noble/curves@^1.4.0", "@noble/curves@^1.6.0", "@noble/curves@~1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== @@ -940,6 +947,11 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== +"@noble/hashes@1.7.1", "@noble/hashes@~1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" + integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== + "@noble/hashes@~1.1.1": version "1.1.5" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" @@ -1456,6 +1468,11 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.8.tgz#8f23646c352f020c83bca750a82789e246d42b50" integrity sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg== +"@scure/base@~1.2.2", "@scure/base@~1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.4.tgz#002eb571a35d69bdb4c214d0995dff76a8dcd2a9" + integrity sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ== + "@scure/bip32@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.0.tgz#dea45875e7fbc720c2b4560325f1cf5d2246d95b" @@ -1483,7 +1500,16 @@ "@noble/hashes" "~1.3.2" "@scure/base" "~1.1.4" -"@scure/bip32@1.5.0", "@scure/bip32@^1.5.0": +"@scure/bip32@1.6.2": + version "1.6.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.6.2.tgz#093caa94961619927659ed0e711a6e4bf35bffd0" + integrity sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw== + dependencies: + "@noble/curves" "~1.8.1" + "@noble/hashes" "~1.7.1" + "@scure/base" "~1.2.2" + +"@scure/bip32@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.5.0.tgz#dd4a2e1b8a9da60e012e776d954c4186db6328e6" integrity sha512-8EnFYkqEQdnkuGBVpCzKxyIwDCBLDVj3oiX0EKUFre/tOjL/Hqba1D6n/8RcmaQy4f95qQFrO2A8Sr6ybh4NRw== @@ -1516,7 +1542,15 @@ "@noble/hashes" "~1.3.2" "@scure/base" "~1.1.4" -"@scure/bip39@1.4.0", "@scure/bip39@^1.4.0": +"@scure/bip39@1.5.4": + version "1.5.4" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.5.4.tgz#07fd920423aa671be4540d59bdd344cc1461db51" + integrity sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA== + dependencies: + "@noble/hashes" "~1.7.1" + "@scure/base" "~1.2.4" + +"@scure/bip39@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.4.0.tgz#664d4f851564e2e1d4bffa0339f9546ea55960a6" integrity sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw== @@ -2220,7 +2254,12 @@ abitype@0.9.8: resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== -abitype@1.0.6, abitype@^1.0.6: +abitype@1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.8.tgz#3554f28b2e9d6e9f35eb59878193eabd1b9f46ba" + integrity sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg== + +abitype@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.6.tgz#76410903e1d88e34f1362746e2d407513c38565b" integrity sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A== @@ -7964,10 +8003,10 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -ox@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ox/-/ox-0.1.2.tgz#0f791be2ccabeaf4928e6d423498fe1c8094e560" - integrity sha512-ak/8K0Rtphg9vnRJlbOdaX9R7cmxD2MiSthjWGaQdMk3D7hrAlDoM+6Lxn7hN52Za3vrXfZ7enfke/5WjolDww== +ox@0.6.7: + version "0.6.7" + resolved "https://registry.yarnpkg.com/ox/-/ox-0.6.7.tgz#afd53f2ecef68b8526660e9d29dee6e6b599a832" + integrity sha512-17Gk/eFsFRAZ80p5eKqv89a57uXjd3NgIf1CaXojATPBuujVc/fQSVhBeAU9JCRB+k7J50WQAyWTxK19T9GgbA== dependencies: "@adraffy/ens-normalize" "^1.10.1" "@noble/curves" "^1.6.0" @@ -10396,19 +10435,18 @@ viem@^1.6.0: isows "1.0.3" ws "8.13.0" -viem@^2.21.48: - version "2.21.48" - resolved "https://registry.yarnpkg.com/viem/-/viem-2.21.48.tgz#f8f1d0bf5381282e22e6a1f8b72ebd6e64426480" - integrity sha512-/hBHyG1gdIIuiQv0z9YmzXl5eWJa0UCZGwkeuQzH2Bmg6FIEwZeEcxgiytXZydip+p2wMBFa1jdr7o5O1+mrIg== +viem@^2.22.16: + version "2.22.16" + resolved "https://registry.yarnpkg.com/viem/-/viem-2.22.16.tgz#f23e3a92284df3d05434d21fbf40b76b8f0b01b6" + integrity sha512-Eb4Ggna2fblb0oHBmy5XZ3Q4cN6fEmKxVpIWHjmAbtYVC9IfbZ28Z1/yZP2oOgvyRrostNndmnR298pgarBVGw== dependencies: - "@noble/curves" "1.6.0" - "@noble/hashes" "1.5.0" - "@scure/bip32" "1.5.0" - "@scure/bip39" "1.4.0" - abitype "1.0.6" + "@noble/curves" "1.8.1" + "@noble/hashes" "1.7.1" + "@scure/bip32" "1.6.2" + "@scure/bip39" "1.5.4" + abitype "1.0.8" isows "1.0.6" - ox "0.1.2" - webauthn-p256 "0.0.10" + ox "0.6.7" ws "8.18.0" wcwidth@^1.0.1: @@ -11106,14 +11144,6 @@ web3@^1.3.5, web3@^1.5.2: web3-shh "1.8.1" web3-utils "1.8.1" -webauthn-p256@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/webauthn-p256/-/webauthn-p256-0.0.10.tgz#877e75abe8348d3e14485932968edf3325fd2fdd" - integrity sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA== - dependencies: - "@noble/curves" "^1.4.0" - "@noble/hashes" "^1.4.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From 82493f8bc7bc61dc4be74f376ee4620834cf83d0 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 13:07:10 +0300 Subject: [PATCH 11/26] update viem --- yarn.lock | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/yarn.lock b/yarn.lock index bff552f8a..502830063 100644 --- a/yarn.lock +++ b/yarn.lock @@ -864,6 +864,11 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== +"@noble/hashes@1.7.1", "@noble/hashes@~1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" + integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1128,6 +1133,11 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.8.tgz#8f23646c352f020c83bca750a82789e246d42b50" integrity sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg== +"@scure/base@~1.2.2", "@scure/base@~1.2.4": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.4.tgz#002eb571a35d69bdb4c214d0995dff76a8dcd2a9" + integrity sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ== + "@scure/bip32@1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" From 2166accb5fbf908cc1ba207cb840fb8c5fb977dd Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 17:03:47 +0300 Subject: [PATCH 12/26] deployment and update --- config/networks.json | 8 ++++---- deployments/abstract.json | 6 +++--- script/deploy/_targetState.json | 2 -- script/deploy/healthCheck.ts | 2 -- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/config/networks.json b/config/networks.json index bbe4fe5df..ff8192959 100644 --- a/config/networks.json +++ b/config/networks.json @@ -25,14 +25,14 @@ "wrappedNativeAddress": "0x3439153EB7AF838Ad19d56E1571FBD09333C2809", "status": "active", "type": "mainnet", - "rpcUrl": "https://api.raas.matterhosted.dev", + "rpcUrl": "https://api.mainnet.abs.xyz", "verificationType": "etherscan", "explorerUrl": "https://abscan.io", "explorerApiUrl": "https://api.abscan.io/api", "multicallAddress": "0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7", - "safeApiUrl": "https://transaction.multisig-abs.w3us.site/api", + "safeApiUrl": "https://transaction.abstract-safe.protofire.io/api", "safeAddress": "0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", - "safeWebUrl": "https://multisig-abs.w3us.site/home?safe=abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", + "safeWebUrl": "https://abstract-safe.protofire.io/home?safe=abstract:0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", "gasZipChainId": 110 }, "apechain": { @@ -701,4 +701,4 @@ "safeWebUrl": "", "gasZipChainId": 0 } -} \ No newline at end of file +} diff --git a/deployments/abstract.json b/deployments/abstract.json index bff7c26cf..29a421568 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -6,7 +6,6 @@ "DexManagerFacet": "0x5bE192BA156263af2ddc5AF633e91490Ac5828e6", "AccessManagerFacet": "0xe24756bC0f197AB82660Ec4312987FBB9a8420f5", "PeripheryRegistryFacet": "0x192C2Efe1A5E38cc65A0a85fe887aE64F6D297E3", - "LIFuelFacet": "0x195d5CBEe915E364B5Ea0ed9B7578aDA41bF23F3", "GenericSwapFacet": "0x67Ae9269BB0363d4d1171eFCB750AAA0D62c0903", "GenericSwapFacetV3": "0x8A942C47151Ee6209c5De84Aa033678eE9663787", "LiFiDiamond": "0x4f8C9056bb8A3616693a76922FA35d53C056E5b3", @@ -22,5 +21,6 @@ "RelayFacet": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "GasZipFacet": "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE", - "GasZipPeriphery": "0x2A3e04627E554b57163C078fd1d6698A655aeA12" -} \ No newline at end of file + "GasZipPeriphery": "0x2A3e04627E554b57163C078fd1d6698A655aeA12", + "EmergencyPauseFacet": "0xDD5ae29dfA6634b186C8f842064A12a09bE9d2F8" +} diff --git a/script/deploy/_targetState.json b/script/deploy/_targetState.json index 76a442d66..1d0ccaa35 100644 --- a/script/deploy/_targetState.json +++ b/script/deploy/_targetState.json @@ -1484,7 +1484,6 @@ "PeripheryRegistryFacet": "1.0.0", "GenericSwapFacet": "1.0.0", "GenericSwapFacetV3": "1.0.1", - "LIFuelFacet": "1.0.1", "CalldataVerificationFacet": "1.1.2", "StandardizedCallFacet": "1.1.0", "EmergencyPauseFacet": "1.0.1", @@ -1493,7 +1492,6 @@ "Executor": "2.0.0", "FeeCollector": "1.0.0", "Receiver": "2.0.2", - "LiFuelFeeCollector": "1.0.1", "TokenWrapper": "1.0.0", "LiFiDEXAggregator": "1.0.0", "Permit2Proxy": "1.0.2", diff --git a/script/deploy/healthCheck.ts b/script/deploy/healthCheck.ts index 8f72ac6f6..7e1a1f061 100644 --- a/script/deploy/healthCheck.ts +++ b/script/deploy/healthCheck.ts @@ -38,7 +38,6 @@ const coreFacets = [ 'PeripheryRegistryFacet', 'GenericSwapFacet', 'GenericSwapFacetV3', - 'LIFuelFacet', 'CalldataVerificationFacet', 'StandardizedCallFacet', ] @@ -48,7 +47,6 @@ const corePeriphery = [ 'Executor', 'Receiver', 'FeeCollector', - 'LiFuelFeeCollector', 'TokenWrapper', ] From b7be7fc97906417c7872237067da4eff9b193f95 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 17:21:51 +0300 Subject: [PATCH 13/26] update logs --- config/networks.json | 4 +-- deployments/_deployments_log_file.json | 44 +++++++++++++++++++++++++- deployments/abstract.diamond.json | 6 ++-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/config/networks.json b/config/networks.json index 5c3a27527..53deb31ed 100644 --- a/config/networks.json +++ b/config/networks.json @@ -27,8 +27,8 @@ "type": "mainnet", "rpcUrl": "https://api.mainnet.abs.xyz", "verificationType": "etherscan", - "explorerUrl": "https://abscan.io", - "explorerApiUrl": "https://api.abscan.io/api", + "explorerUrl": "https://abscan.org", + "explorerApiUrl": "https://api.abscan.org/api", "multicallAddress": "0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7", "safeApiUrl": "https://transaction.abstract-safe.protofire.io/api", "safeAddress": "0x257CBCDc7FcBA79a83149C9D7160ef15A86FA39c", diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index d0ddf8185..bee2e511d 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -746,6 +746,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xA9bD7d5304a24c005D37Dc7Dfe844464F9ca718c", + "OPTIMIZER_RUNS": "200", + "TIMESTAMP": "2025-01-28T14:20:24.363Z", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": true + } + ] + } } }, "DiamondLoupeFacet": { @@ -1482,6 +1496,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xABf05526621346D3526abBa79515D3A0182bAe05", + "OPTIMIZER_RUNS": "200", + "TIMESTAMP": "2025-01-28T14:20:24.574Z", + "CONSTRUCTOR_ARGS": "0x", + "SALT": "", + "VERIFIED": true + } + ] + } } }, "OwnershipFacet": { @@ -25830,6 +25858,20 @@ } ] } + }, + "abstract": { + "production": { + "1.0.1": [ + { + "ADDRESS": "0xDD5ae29dfA6634b186C8f842064A12a09bE9d2F8", + "OPTIMIZER_RUNS": "200", + "TIMESTAMP": "2025-01-28T14:20:29.530Z", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee", + "SALT": "", + "VERIFIED": true + } + ] + } } }, "AcrossFacetV3": { @@ -28035,7 +28077,7 @@ "ADDRESS": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", "OPTIMIZER_RUNS": "1000000", "TIMESTAMP": "2025-01-14 16:32:35", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef" } ] } diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json index 69ddb4333..5d9d00052 100644 --- a/deployments/abstract.diamond.json +++ b/deployments/abstract.diamond.json @@ -29,8 +29,8 @@ "Name": "PeripheryRegistryFacet", "Version": "1.0.0" }, - "0x195d5CBEe915E364B5Ea0ed9B7578aDA41bF23F3": { - "Name": "LIFuelFacet", + "0xDD5ae29dfA6634b186C8f842064A12a09bE9d2F8": { + "Name": "EmergencyPauseFacet", "Version": "1.0.1" }, "0x67Ae9269BB0363d4d1171eFCB750AAA0D62c0903": { @@ -72,7 +72,7 @@ "Permit2Proxy": "", "ReceiverAcrossV3": "", "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", - "ReceiverStargateV2": "0x37d7fD457Bef56E79bE3b8bd286eeBEFF14b578f", + "ReceiverStargateV2": "0x83D2B4f5834d7aDE97E5837781ecfC99D9Cbe004", "RelayerCelerIM": "", "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1" } From 121ded7dcaca42f3a7db1a4ac007e398f9bf0b23 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 17:33:44 +0300 Subject: [PATCH 14/26] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- script/deploy/zksync/DeployLiFiDEXAggregator.s.sol | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol index d224c5eba..913aaf6f0 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol @@ -31,18 +31,14 @@ contract DeployScript is DeployScriptBase { // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox // 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" ); + require( + withdrawWalletAddress != address(0), + "Withdraw wallet cannot be zero address" + ); return abi.encode(address(0), priviledgedUsers, withdrawWalletAddress); } } From 4d1d21a4d6d91e3e38423b034e6293cf63d5619e Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 17:36:46 +0300 Subject: [PATCH 15/26] update .env.example --- .env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env.example b/.env.example index 69c4dbd0d..6d0daff12 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,7 @@ PRIVATE_KEY= # Mainnet RPCs (the 'pre-commit-checker' comment after the URL is only for our internal tool and not required in your .env file) ETH_NODE_URI_MAINNET=https://1rpc.io/eth #[pre-commit-checker: not a secret] +ETH_NODE_URI_ABSTRACT=https://api.mainnet.abs.xyz #[pre-commit-checker: not a secret] ETH_NODE_URI_ARBITRUM=https://1rpc.io/arb #[pre-commit-checker: not a secret] ETH_NODE_URI_AURORA=https://1rpc.io/aurora #[pre-commit-checker: not a secret] ETH_NODE_URI_AVALANCHE=https://1rpc.io/avax/c #[pre-commit-checker: not a secret] @@ -45,6 +46,7 @@ ETH_NODE_URI_ZKSYNC_GOERLI=https://zksync2-testnet.zksync.dev #[pre-commit-check # Mainnet Explorer API Keys MAINNET_ETHERSCAN_API_KEY= +ABSTRACT_ETHERSCAN_API_KEY= AURORA_ETHERSCAN_API_KEY= BOBA_ETHERSCAN_API_KEY= FUSE_ETHERSCAN_API_KEY= From 64c0d97b89a9c1ec80ce624cfc6da14e4be4605b Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Tue, 28 Jan 2025 17:38:28 +0300 Subject: [PATCH 16/26] Update script/deploy/zksync/DeployLiFiDEXAggregator.s.sol Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- script/deploy/zksync/DeployLiFiDEXAggregator.s.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol index 913aaf6f0..44ed7ca18 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol @@ -30,9 +30,8 @@ contract DeployScript is DeployScriptBase { // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox - // get path of global config file // extract withdrawWallet address - address withdrawWalletAddress = globalConfigJson.readAddress( + address withdrawWalletAddress = json.readAddress( ".withdrawWallet" ); require( From 6deb02c39733e093615eb42de099faae96f3edb5 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 29 Jan 2025 10:29:34 +0300 Subject: [PATCH 17/26] remove unused files --- script/deploy/safe/config.ts | 2 +- script/deploy/zksync/DeployLIFuelFacet.s.sol | 20 -- .../zksync/DeployLiFiDEXAggregator.s.sol | 11 +- script/deploy/zksync/DeployRelayFacet.s_1.sol | 36 --- script/deploy/zksync/UpdateCoreFacets.s.sol | 165 ----------- script/deploy/zksync/utils/ScriptBase.sol | 45 --- .../deploy/zksync/utils/UpdateScriptBase.sol | 266 ------------------ 7 files changed, 2 insertions(+), 543 deletions(-) delete mode 100644 script/deploy/zksync/DeployLIFuelFacet.s.sol delete mode 100644 script/deploy/zksync/DeployRelayFacet.s_1.sol delete mode 100644 script/deploy/zksync/UpdateCoreFacets.s.sol delete mode 100644 script/deploy/zksync/utils/ScriptBase.sol delete mode 100644 script/deploy/zksync/utils/UpdateScriptBase.sol diff --git a/script/deploy/safe/config.ts b/script/deploy/safe/config.ts index 1207faea4..580705b3c 100644 --- a/script/deploy/safe/config.ts +++ b/script/deploy/safe/config.ts @@ -24,7 +24,7 @@ export const getSafeUtilityContracts = (chainId: number) => { break case 324: case 2741: - // zkSync + // zkSync && abstract contractNetworks = { [chainId.toString()]: { multiSendAddress: '0x0dFcccB95225ffB03c6FBB2559B530C2B7C8A912', diff --git a/script/deploy/zksync/DeployLIFuelFacet.s.sol b/script/deploy/zksync/DeployLIFuelFacet.s.sol deleted file mode 100644 index a7fcd8ee8..000000000 --- a/script/deploy/zksync/DeployLIFuelFacet.s.sol +++ /dev/null @@ -1,20 +0,0 @@ -// 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 913aaf6f0..d4082faab 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol @@ -29,16 +29,7 @@ contract DeployScript is DeployScriptBase { priviledgedUsers[0] = json.readAddress(".pauserWallet"); // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox - - // get path of global config file - // extract withdrawWallet address - address withdrawWalletAddress = globalConfigJson.readAddress( - ".withdrawWallet" - ); - require( - withdrawWalletAddress != address(0), - "Withdraw wallet cannot be zero address" - ); + address withdrawWalletAddress = json.readAddress(".withdrawWallet"); return abi.encode(address(0), priviledgedUsers, withdrawWalletAddress); } } diff --git a/script/deploy/zksync/DeployRelayFacet.s_1.sol b/script/deploy/zksync/DeployRelayFacet.s_1.sol deleted file mode 100644 index f1382e220..000000000 --- a/script/deploy/zksync/DeployRelayFacet.s_1.sol +++ /dev/null @@ -1,36 +0,0 @@ -// 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/UpdateCoreFacets.s.sol b/script/deploy/zksync/UpdateCoreFacets.s.sol deleted file mode 100644 index a19863189..000000000 --- a/script/deploy/zksync/UpdateCoreFacets.s.sol +++ /dev/null @@ -1,165 +0,0 @@ -// 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/ScriptBase.sol b/script/deploy/zksync/utils/ScriptBase.sol deleted file mode 100644 index 506a3aa8b..000000000 --- a/script/deploy/zksync/utils/ScriptBase.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.17; - -import { Script, console } from "forge-std/Script.sol"; -import { DSTest } from "ds-test/test.sol"; -import { LibAsset } from "lifi/Libraries/LibAsset.sol"; -import { stdJson } from "forge-std/Script.sol"; - -contract ScriptBase is Script, DSTest { - using stdJson for string; - - error NotAContract(string key); - - uint256 internal deployerPrivateKey; - address internal deployerAddress; - string internal root; - string internal network; - string internal fileSuffix; - - constructor() { - deployerPrivateKey = uint256(vm.envBytes32("PRIVATE_KEY")); - deployerAddress = vm.addr(deployerPrivateKey); - root = vm.projectRoot(); - network = vm.envString("NETWORK"); - fileSuffix = vm.envString("FILE_SUFFIX"); - } - - // reads an address from a config file and makes sure that the address contains code - function _getConfigContractAddress( - string memory path, - string memory key - ) internal returns (address contractAddress) { - // load json file - string memory json = vm.readFile(path); - - // read address - contractAddress = json.readAddress(key); - - // check if address contains code - if (!LibAsset.isContract(contractAddress)) - revert( - string.concat(key, " in file ", path, " is not a contract") - ); - } -} diff --git a/script/deploy/zksync/utils/UpdateScriptBase.sol b/script/deploy/zksync/utils/UpdateScriptBase.sol deleted file mode 100644 index 717f395f5..000000000 --- a/script/deploy/zksync/utils/UpdateScriptBase.sol +++ /dev/null @@ -1,266 +0,0 @@ -// 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 - ); - } - } -} From a787ff800e10195c018979fa20d7328dd248fcc6 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Wed, 29 Jan 2025 10:38:40 +0300 Subject: [PATCH 18/26] udpate to use config helper --- script/deploy/zksync/DeployLiFiDEXAggregator.s.sol | 8 +++++--- script/deploy/zksync/DeployReceiverStargateV2.s.sol | 10 +++++----- script/deploy/zksync/DeployStargateFacetV2.s.sol | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol index d4082faab..4d14c5edd 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.s.sol @@ -23,13 +23,15 @@ contract DeployScript is DeployScriptBase { function getConstructorArgs() internal override returns (bytes memory) { string memory path = string.concat(root, "/config/global.json"); - string memory json = vm.readFile(path); address[] memory priviledgedUsers = new address[](1); - priviledgedUsers[0] = json.readAddress(".pauserWallet"); + priviledgedUsers[0] = _getConfigContractAddress(path, ".pauserWallet"); // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox - address withdrawWalletAddress = json.readAddress(".withdrawWallet"); + address withdrawWalletAddress = _getConfigContractAddress( + path, + ".withdrawWallet" + ); return abi.encode(address(0), priviledgedUsers, withdrawWalletAddress); } } diff --git a/script/deploy/zksync/DeployReceiverStargateV2.s.sol b/script/deploy/zksync/DeployReceiverStargateV2.s.sol index 15f2daca4..126da67dc 100644 --- a/script/deploy/zksync/DeployReceiverStargateV2.s.sol +++ b/script/deploy/zksync/DeployReceiverStargateV2.s.sol @@ -38,12 +38,13 @@ contract DeployScript is DeployScriptBase { // 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( + address endpointV2 = _getConfigContractAddress( + path, string.concat(".endpointV2.", network) ); - address tokenMessaging = json.readAddress( + address tokenMessaging = _getConfigContractAddress( + path, string.concat(".tokenMessaging.", network) ); @@ -56,8 +57,7 @@ contract DeployScript is DeployScriptBase { fileSuffix, "json" ); - json = vm.readFile(path); - address executor = json.readAddress(".Executor"); + address executor = _getConfigContractAddress(path, ".Executor"); return abi.encode( diff --git a/script/deploy/zksync/DeployStargateFacetV2.s.sol b/script/deploy/zksync/DeployStargateFacetV2.s.sol index dca898e6c..8fda09172 100644 --- a/script/deploy/zksync/DeployStargateFacetV2.s.sol +++ b/script/deploy/zksync/DeployStargateFacetV2.s.sol @@ -21,9 +21,9 @@ contract DeployScript is DeployScriptBase { 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( + address tokenMessaging = _getConfigContractAddress( + path, string.concat(".tokenMessaging.", network) ); From b584e86f52a405bf7655e082e91d675948fc5d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 08:00:21 +0700 Subject: [PATCH 19/26] update config --- config/symbiosis.json | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/config/symbiosis.json b/config/symbiosis.json index ed09db678..22ef91771 100644 --- a/config/symbiosis.json +++ b/config/symbiosis.json @@ -3,6 +3,10 @@ "metaRouter": "0xf621Fb08BBE51aF70e7E0F4EA63496894166Ff7F", "gateway": "0xfCEF2Fe72413b65d3F393d278A714caD87512bcd" }, + "abstract": { + "metaRouter": "0x2E818E50b913457015E1277B43E469b63AC5D3d7", + "gateway": "0x664376638fE57642342009f49E1Ca4caf74b26D3" + }, "arbitrum": { "metaRouter": "0xf7e96217347667064DEE8f20DB747B1C7df45DDe", "gateway": "0x80ddDDa846e779cceE463bDC0BCc2Ae296feDaF9" @@ -43,6 +47,18 @@ "metaRouter": "0x9A31bAC4b3B958C835C243800B474818D04393dd", "gateway": "0x83f71AabdDBb9F0E3B6462Cc7635b6fFAD0f2f2e" }, + "metis": { + "metaRouter": "0xf85FC807D05d3Ab2309364226970aAc57b4e1ea4", + "gateway": "0xcd7C056b39DdFB568E451923ABEDb9B6a7Aeb885" + }, + "mode": { + "metaRouter": "0xcE8f24A58D85eD5c5A6824f7be1F8d4711A0eb4C", + "gateway": "0xAdB2d3b711Bb8d8Ea92ff70292c466140432c278" + }, + "mantle": { + "metaRouter": "0xca506793A420E901BbCa8066be5661E3C52c84c2", + "gateway": "0xd92Ca299F1C2518E78E48C207b64591BA6E9b9a8" + }, "optimism": { "metaRouter": "0x0f91052dc5B4baE53d0FeA5DAe561A117268f5d2", "gateway": "0x200a0fe876421DC49A26508e3Efd0a1008fD12B5" @@ -51,10 +67,6 @@ "metaRouter": "0xa260E3732593E4EcF9DdC144fD6C4c5fe7077978", "gateway": "0xAb83653fd41511D638b69229afBf998Eb9B0F30c" }, - "zksync": { - "metaRouter": "0x38307CB291Af47Af9847c134a34E9477c939Ca28", - "gateway": "0x8cA239448AdD34b057D1CB5934F12AC899DB66e1" - }, "polygonzkevm": { "metaRouter": "0xb91d3060C90aac7c4c706aef2B37997b3b2a1DcF", "gateway": "0x668961F4923A4FB96b22ad1F18aE215bB2694593" @@ -67,24 +79,20 @@ "metaRouter": "0x624FFe62eBa13e6057878bCA1D7A9E35651E1D9c", "gateway": "0x49952ff32FcBc3408D447E1E91Da2b44BD2D1AFE" }, - "metis": { - "metaRouter": "0xf85FC807D05d3Ab2309364226970aAc57b4e1ea4", - "gateway": "0xcd7C056b39DdFB568E451923ABEDb9B6a7Aeb885" - }, - "mode": { - "metaRouter": "0xcE8f24A58D85eD5c5A6824f7be1F8d4711A0eb4C", - "gateway": "0xAdB2d3b711Bb8d8Ea92ff70292c466140432c278" - }, - "mantle": { - "metaRouter": "0xca506793A420E901BbCa8066be5661E3C52c84c2", - "gateway": "0xd92Ca299F1C2518E78E48C207b64591BA6E9b9a8" - }, "sei": { "metaRouter": "0xcE8f24A58D85eD5c5A6824f7be1F8d4711A0eb4C", "gateway": "0xAdB2d3b711Bb8d8Ea92ff70292c466140432c278" }, + "sonic": { + "metaRouter": "0xda8057acB94905eb6025120cB2c38415Fd81BfEB", + "gateway": "0xb7aF032a0C8d350705eD7E4E3802377731a0cA07" + }, "taiko": { "metaRouter": "0x7057aB3fB2BeE9c18e0cDe4240DE4ff7f159E365", "gateway": "0xa0079829B9F1Edc5DD0DE3eC104f281745C4bD81" + }, + "zksync": { + "metaRouter": "0x38307CB291Af47Af9847c134a34E9477c939Ca28", + "gateway": "0x8cA239448AdD34b057D1CB5934F12AC899DB66e1" } } From 21ce9088a71ba15448a2b289d1dfd86a43736f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 08:40:27 +0700 Subject: [PATCH 20/26] deploy to sonic and abstract (verified) --- deployments/_deployments_log_file.json | 30 +++++++++++- deployments/abstract.json | 5 +- deployments/sonic.json | 47 ++++++++++--------- .../deploy/zksync/DeploySymbiosisFacet.s.sol | 35 ++++++++++++++ 4 files changed, 91 insertions(+), 26 deletions(-) create mode 100644 script/deploy/zksync/DeploySymbiosisFacet.s.sol diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index bee2e511d..5c4d0839c 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -22649,6 +22649,34 @@ } ] } + }, + "abstract": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xe4db6A19c9F53fB946D31772a48002e1f9cB8763", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-30 08:23:59", + "CONSTRUCTOR_ARGS": "0x0000000000000000000000002e818e50b913457015e1277b43e469b63ac5d3d7000000000000000000000000664376638fe57642342009f49e1ca4caf74b26d3", + "SALT": "", + "VERIFIED": "true" + } + ] + } + }, + "sonic": { + "production": { + "1.0.0": [ + { + "ADDRESS": "0xC8C286F373c5b4a4c6a2D6369003477D76584D7F", + "OPTIMIZER_RUNS": "1000000", + "TIMESTAMP": "2025-01-30 08:38:20", + "CONSTRUCTOR_ARGS": "0x000000000000000000000000da8057acb94905eb6025120cb2c38415fd81bfeb000000000000000000000000b7af032a0c8d350705ed7e4e3802377731a0ca07", + "SALT": "", + "VERIFIED": "false" + } + ] + } } }, "MayanBridgeFacet": { @@ -28143,4 +28171,4 @@ } } } -} \ No newline at end of file +} diff --git a/deployments/abstract.json b/deployments/abstract.json index 29a421568..faee3b602 100644 --- a/deployments/abstract.json +++ b/deployments/abstract.json @@ -22,5 +22,6 @@ "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "GasZipFacet": "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE", "GasZipPeriphery": "0x2A3e04627E554b57163C078fd1d6698A655aeA12", - "EmergencyPauseFacet": "0xDD5ae29dfA6634b186C8f842064A12a09bE9d2F8" -} + "EmergencyPauseFacet": "0xDD5ae29dfA6634b186C8f842064A12a09bE9d2F8", + "SymbiosisFacet": "0xe4db6A19c9F53fB946D31772a48002e1f9cB8763" +} \ No newline at end of file diff --git a/deployments/sonic.json b/deployments/sonic.json index ba2cfb34b..2ee2ba399 100644 --- a/deployments/sonic.json +++ b/deployments/sonic.json @@ -1,25 +1,26 @@ { - "DiamondCutFacet": "0x7052D07D749Cb8446E32098B7ba64ad12Cf638be", - "DiamondLoupeFacet": "0xEB014fd2fd6e6f9C79d31f7fE4AF2B8B5694A03f", - "OwnershipFacet": "0x1AA34e2BcA10BfA3ab770E680409090458Aa550A", - "DexManagerFacet": "0x8158CB90bd860ff75a8FA152611bff0Db3b28360", - "AccessManagerFacet": "0xF72c17d1e3b047Ff8f7e9617c6b7E4c9c335eD08", - "WithdrawFacet": "0xdcf9bef6B1197979876cEfbAA4507F68A50Ce8Ad", - "PeripheryRegistryFacet": "0x2Db2A9Df6f42eeA36f4f9003be8C0cCd2d439bd0", - "GenericSwapFacet": "0x2e640bB8452aA810ED8c259054661E9BE3f2704B", - "LIFuelFacet": "0x1172FAF198C05121e858a9e504EF68f2bAe38833", - "CalldataVerificationFacet": "0x70A18260Be23D9E154cad53e049A55B95221EA82", - "StandardizedCallFacet": "0x6408794f2752e0e8a389813D47cFc5452A4133Aa", - "LiFiDiamond": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE", - "GenericSwapFacetV3": "0xf24c9914D3a89F16aD9C87fa549FF24359a31715", - "EmergencyPauseFacet": "0x92a0479cc9D087874faEBA3402891BEafFfB9d8e", - "GasZipFacet": "0xe5CDC4f90B30dA151f7257A02988102c339Db1cA", - "ERC20Proxy": "0x55A5cE71307Ec425F0E533400A0bcEb136e6E800", - "Executor": "0x1B874Aae59d738079Fe3E4F7D90B5793D3a51481", - "FeeCollector": "0xaFb8cC8fCd71cd768Ce117C11eB723119FCDb1f8", - "Receiver": "0xbE539601FDf7736A4Dd730008082Bf2C16e6f728", - "LiFuelFeeCollector": "0xbA01f8b54F8F6B3789Bc9E1Bbd7206bE4e6830e5", - "TokenWrapper": "0x51f5A9675A0663C3EC2b46121eB1504687922911", - "LiFiDEXAggregator": "0xAdf8d87723Ec7f011Ae56DDD6dC10FA8b2C3863A", - "GasZipPeriphery": "0x3925eFbD0C1d9c119eC771649052eed7587094AA" + "DiamondCutFacet": "0x7052D07D749Cb8446E32098B7ba64ad12Cf638be", + "DiamondLoupeFacet": "0xEB014fd2fd6e6f9C79d31f7fE4AF2B8B5694A03f", + "OwnershipFacet": "0x1AA34e2BcA10BfA3ab770E680409090458Aa550A", + "DexManagerFacet": "0x8158CB90bd860ff75a8FA152611bff0Db3b28360", + "AccessManagerFacet": "0xF72c17d1e3b047Ff8f7e9617c6b7E4c9c335eD08", + "WithdrawFacet": "0xdcf9bef6B1197979876cEfbAA4507F68A50Ce8Ad", + "PeripheryRegistryFacet": "0x2Db2A9Df6f42eeA36f4f9003be8C0cCd2d439bd0", + "GenericSwapFacet": "0x2e640bB8452aA810ED8c259054661E9BE3f2704B", + "LIFuelFacet": "0x1172FAF198C05121e858a9e504EF68f2bAe38833", + "CalldataVerificationFacet": "0x70A18260Be23D9E154cad53e049A55B95221EA82", + "StandardizedCallFacet": "0x6408794f2752e0e8a389813D47cFc5452A4133Aa", + "LiFiDiamond": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE", + "GenericSwapFacetV3": "0xf24c9914D3a89F16aD9C87fa549FF24359a31715", + "EmergencyPauseFacet": "0x92a0479cc9D087874faEBA3402891BEafFfB9d8e", + "GasZipFacet": "0xe5CDC4f90B30dA151f7257A02988102c339Db1cA", + "ERC20Proxy": "0x55A5cE71307Ec425F0E533400A0bcEb136e6E800", + "Executor": "0x1B874Aae59d738079Fe3E4F7D90B5793D3a51481", + "FeeCollector": "0xaFb8cC8fCd71cd768Ce117C11eB723119FCDb1f8", + "Receiver": "0xbE539601FDf7736A4Dd730008082Bf2C16e6f728", + "LiFuelFeeCollector": "0xbA01f8b54F8F6B3789Bc9E1Bbd7206bE4e6830e5", + "TokenWrapper": "0x51f5A9675A0663C3EC2b46121eB1504687922911", + "LiFiDEXAggregator": "0xAdf8d87723Ec7f011Ae56DDD6dC10FA8b2C3863A", + "GasZipPeriphery": "0x3925eFbD0C1d9c119eC771649052eed7587094AA", + "SymbiosisFacet": "0xC8C286F373c5b4a4c6a2D6369003477D76584D7F" } \ No newline at end of file diff --git a/script/deploy/zksync/DeploySymbiosisFacet.s.sol b/script/deploy/zksync/DeploySymbiosisFacet.s.sol new file mode 100644 index 000000000..980d786f9 --- /dev/null +++ b/script/deploy/zksync/DeploySymbiosisFacet.s.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.17; + +import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; +import { stdJson } from "forge-std/Script.sol"; +import { SymbiosisFacet } from "lifi/Facets/SymbiosisFacet.sol"; + +contract DeployScript is DeployScriptBase { + using stdJson for string; + + constructor() DeployScriptBase("SymbiosisFacet") {} + + function run() + public + returns (SymbiosisFacet deployed, bytes memory constructorArgs) + { + constructorArgs = getConstructorArgs(); + deployed = SymbiosisFacet(deploy(type(SymbiosisFacet).creationCode)); + } + + function getConstructorArgs() internal override returns (bytes memory) { + string memory path = string.concat(root, "/config/symbiosis.json"); + + address metaRouter = _getConfigContractAddress( + path, + string.concat(".", network, ".metaRouter") + ); + address gateway = _getConfigContractAddress( + path, + string.concat(".", network, ".gateway") + ); + + return abi.encode(metaRouter, gateway); + } +} From ee573b8cc3642c634f97b02d6c326ab8af3dd836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 08:43:35 +0700 Subject: [PATCH 21/26] improved getChainId helper function to read from networks.json --- script/helperFunctions.sh | 197 +++----------------------------------- 1 file changed, 14 insertions(+), 183 deletions(-) diff --git a/script/helperFunctions.sh b/script/helperFunctions.sh index d29d62184..55ec81bfa 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -2797,193 +2797,24 @@ function getPrivateKey() { fi fi } + function getChainId() { - # read function arguments into variables - NETWORK="$1" + local NETWORK="$1" + local NETWORKS_JSON="config/networks.json" - # return chainId - case $NETWORK in - "mainnet") - echo "1" - return 0 - ;; - "abstract") - echo "2741" - return 0 - ;; - "blast") - echo "81457" - return 0 - ;; - "bsc") - echo "56" - return 0 - ;; - "polygon") - echo "137" - return 0 - ;; - "polygonzkevm") - echo "1101" - return 0 - ;; - "rootstock") - echo "30" - return 0 - ;; - "gnosis") - echo "100" - return 0 - ;; - "fraxtal") - echo "252" - return 0 - ;; - "fantom") - echo "250" - return 0 - ;; - "gravity") - echo "1625" - return 0 - ;; - "okx") - echo "66" - return 0 - ;; - "avalanche") - echo "43114" - return 0 - ;; - "arbitrum") - echo "42161" - return 0 - ;; - "optimism") - echo "10" - return 0 - ;; - "moonriver") - echo "1285" - return 0 - ;; - "moonbeam") - echo "1284" - return 0 - ;; - "celo") - echo "42220" - return 0 - ;; - "fuse") - echo "122" - return 0 - ;; - "cronos") - echo "25" - return 0 - ;; - "velas") - echo "106" - return 0 - ;; - "harmony") - echo "1666600000" - return 0 - ;; - "evmos") - echo "9001" - return 0 - ;; - "aurora") - echo "1313161554" - return 0 - ;; - "base") - echo "8453" - return 0 - ;; - "boba") - echo "288" - return 0 - ;; - "nova") - echo "87" - return 0 - ;; - "mode") - echo "34443" - return 0 - ;; - "scroll") - echo "534352" - return 0 - ;; - "goerli") - echo "5" - return 0 - ;; - "bsc-testnet") - echo "97" - return 0 - ;; - "sepolia") - echo "11155111" - return 0 - ;; - "mumbai") - echo "80001" - return 0 - ;; - "lineatest") - echo "59140" - return 0 - ;; - "linea") - echo "59144" - return 0 - ;; - "opbnb") - echo "204" - return 0 - ;; - "metis") - echo "1088" - return 0 - ;; - "localanvil") - echo "31337" - return 0 - ;; - "zksync") - echo "324" - return 0 - ;; - "mantle") - echo "5000" - return 0 - ;; - "sei") - echo "1329" - return 0 - ;; - "immutablezkevm") - echo "13371" - return 0 - ;; - "xlayer") - echo "196" - return 0 - ;; - "taiko") - echo "167000" - return 0 - ;; - *) + if [[ ! -f "$NETWORKS_JSON" ]]; then + echo "Error: JSON file '$NETWORKS_JSON' not found." >&2 return 1 - ;; - esac + fi + + local CHAIN_ID=$(jq -r --arg network "$NETWORK" '.[$network].chainId // empty' "$NETWORKS_JSON") + + if [[ -z "$CHAIN_ID" ]]; then + echo "Error: Network '$NETWORK' not found in '$NETWORKS_JSON'." >&2 + return 1 + fi + echo "$CHAIN_ID" } function getCreate3FactoryAddress() { From 6a607e37213155cfc9e1a6b67a95a8ba30010394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 08:44:09 +0700 Subject: [PATCH 22/26] script fixes --- script/deploy/safe/propose-to-safe.ts | 5 +++-- script/tasks/diamondUpdateFacet.sh | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/script/deploy/safe/propose-to-safe.ts b/script/deploy/safe/propose-to-safe.ts index fc8efe655..2330054fb 100644 --- a/script/deploy/safe/propose-to-safe.ts +++ b/script/deploy/safe/propose-to-safe.ts @@ -1,8 +1,9 @@ import { defineCommand, runMain } from 'citty' import { type SafeApiKitConfig } from '@safe-global/api-kit' import type { Chain } from 'viem' -import Safe, { EthersAdapter } from '@safe-global/protocol-kit' -import SafeApiKit from '@safe-global/api-kit' +import { EthersAdapter } from '@safe-global/protocol-kit' +const { default: SafeApiKit } = await import('@safe-global/api-kit') +const { default: Safe } = await import('@safe-global/protocol-kit') import { ethers } from 'ethers6' import { OperationType, diff --git a/script/tasks/diamondUpdateFacet.sh b/script/tasks/diamondUpdateFacet.sh index 6be6a6156..615a39dfb 100755 --- a/script/tasks/diamondUpdateFacet.sh +++ b/script/tasks/diamondUpdateFacet.sh @@ -114,9 +114,9 @@ diamondUpdateFacet() { PRIVATE_KEY=$(getPrivateKey $NETWORK $ENVIRONMENT) echoDebug "Calculating facet cuts for $SCRIPT..." if [[ $NETWORK == "zksync" ]]; then - RAW_RETURN_DATA=$(docker run --rm -it --volume .:/foundry -u $(id -u):$(id -g) -e FOUNDRY_PROFILE=zksync -e NO_BROADCAST=true -e NETWORK=$NETWORK -e FILE_SUFFIX=$FILE_SUFFIX -e USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND -e PRIVATE_KEY=$PRIVATE_KEY foundry-zksync forge script "$UPDATE_SCRIPT" -f $NETWORK -vvvv --json --silent --skip-simulation --legacy --slow --zksync) + RAW_RETURN_DATA=$(docker run --rm -it --volume .:/foundry -u $(id -u):$(id -g) -e FOUNDRY_PROFILE=zksync -e NO_BROADCAST=true -e NETWORK=$NETWORK -e FILE_SUFFIX=$FILE_SUFFIX -e USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND -e PRIVATE_KEY=$PRIVATE_KEY foundry-zksync forge script "$UPDATE_SCRIPT" -f $NETWORK --json --skip-simulation --legacy --slow --zksync) else - RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK -vvvv --json --silent --skip-simulation --legacy) + RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK --json --skip-simulation --legacy) fi CLEAN_RETURN_DATA=$(echo $RAW_RETURN_DATA | sed 's/^.*{\"logs/{\"logs/') FACET_CUT=$(echo $CLEAN_RETURN_DATA | jq -r '.returns.cutData.value') @@ -128,7 +128,7 @@ diamondUpdateFacet() { fi else # STAGING: just deploy normally without further checks - RAW_RETURN_DATA=$(NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND NO_BROADCAST=false PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") forge script "$SCRIPT_PATH" -f $NETWORK -vvvv --json --silent --broadcast --skip-simulation --legacy) + RAW_RETURN_DATA=$(NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND NO_BROADCAST=false PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") forge script "$SCRIPT_PATH" -f $NETWORK --json --broadcast --skip-simulation --legacy) fi else # check if we are deploying to PROD @@ -137,7 +137,7 @@ diamondUpdateFacet() { UPDATE_SCRIPT=$(echo "$DEPLOY_SCRIPT_DIRECTORY"Update"$SCRIPT".s.sol) PRIVATE_KEY=$(getPrivateKey $NETWORK $ENVIRONMENT) echoDebug "Calculating facet cuts for $script..." - RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK -vvvv --json --silent --skip-simulation --legacy) + RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK --json --skip-simulation --legacy) CLEAN_RETURN_DATA=$(echo $RAW_RETURN_DATA | sed 's/^.*{\"logs/{\"logs/') FACET_CUT=$(echo $CLEAN_RETURN_DATA | jq -r '.returns.cutData.value') if [ "$FACET_CUT" != "0x" ]; then @@ -147,7 +147,7 @@ diamondUpdateFacet() { fi else # STAGING: just deploy normally without further checks - RAW_RETURN_DATA=$(NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND NO_BROADCAST=false PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") forge script "$SCRIPT_PATH" -f $NETWORK -vvvv --json --silent --broadcast --skip-simulation --legacy) + RAW_RETURN_DATA=$(NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND NO_BROADCAST=false PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") forge script "$SCRIPT_PATH" -f $NETWORK --json --broadcast --skip-simulation --legacy) fi fi RETURN_CODE=$? From de9100919a9b19c367091d19dd09dd0f5c63761c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 08:57:17 +0700 Subject: [PATCH 23/26] rename zksync deploy script in anticipation of other PR --- ...ploySymbiosisFacet.s.sol => DeploySymbiosisFacet.zksync.s.sol} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename script/deploy/zksync/{DeploySymbiosisFacet.s.sol => DeploySymbiosisFacet.zksync.s.sol} (100%) diff --git a/script/deploy/zksync/DeploySymbiosisFacet.s.sol b/script/deploy/zksync/DeploySymbiosisFacet.zksync.s.sol similarity index 100% rename from script/deploy/zksync/DeploySymbiosisFacet.s.sol rename to script/deploy/zksync/DeploySymbiosisFacet.zksync.s.sol From 2ec39b5c5929bdcc80cdf022c8261aaceb5676cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 30 Jan 2025 17:05:19 +0700 Subject: [PATCH 24/26] diamond logs updated --- deployments/abstract.diamond.json | 6 +++++- deployments/sonic.diamond.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json index 5d9d00052..3e74e4308 100644 --- a/deployments/abstract.diamond.json +++ b/deployments/abstract.diamond.json @@ -60,6 +60,10 @@ "0x79ae44B0C33FDC804EB0A6e4A1c1434565264cfE": { "Name": "GasZipFacet", "Version": "2.0.2" + }, + "0xe4db6A19c9F53fB946D31772a48002e1f9cB8763": { + "Name": "SymbiosisFacet", + "Version": "1.0.0" } }, "Periphery": { @@ -70,8 +74,8 @@ "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "LiFuelFeeCollector": "", "Permit2Proxy": "", - "ReceiverAcrossV3": "", "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "ReceiverAcrossV3": "", "ReceiverStargateV2": "0x83D2B4f5834d7aDE97E5837781ecfC99D9Cbe004", "RelayerCelerIM": "", "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1" diff --git a/deployments/sonic.diamond.json b/deployments/sonic.diamond.json index 40e20d569..d4862ac10 100644 --- a/deployments/sonic.diamond.json +++ b/deployments/sonic.diamond.json @@ -56,6 +56,10 @@ "0xe5CDC4f90B30dA151f7257A02988102c339Db1cA": { "Name": "GasZipFacet", "Version": "2.0.0" + }, + "0xC8C286F373c5b4a4c6a2D6369003477D76584D7F": { + "Name": "SymbiosisFacet", + "Version": "1.0.0" } }, "Periphery": { @@ -66,8 +70,8 @@ "LiFiDEXAggregator": "0xAdf8d87723Ec7f011Ae56DDD6dC10FA8b2C3863A", "LiFuelFeeCollector": "0xbA01f8b54F8F6B3789Bc9E1Bbd7206bE4e6830e5", "Permit2Proxy": "", - "ReceiverAcrossV3": "", "Receiver": "0xbE539601FDf7736A4Dd730008082Bf2C16e6f728", + "ReceiverAcrossV3": "", "ReceiverStargateV2": "", "RelayerCelerIM": "", "TokenWrapper": "0x51f5A9675A0663C3EC2b46121eB1504687922911" From 0be521e46103d3653772959d25fa5151413aff68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Wed, 5 Feb 2025 17:31:41 +0700 Subject: [PATCH 25/26] fix merge issues --- script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol | 2 +- script/helperFunctions.sh | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol index 6f17f0a29..c579ad0ef 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol @@ -26,7 +26,7 @@ contract DeployScript is DeployScriptBase { string memory json = vm.readFile(path); address[] memory priviledgedUsers = new address[](1); - priviledgedUsers[0] = _getConfigContractAddress(path, ".pauserWallet"); + priviledgedUsers[0] = json.readAddress(".pauserWallet"); // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox address refundWalletAddress = json.readAddress(".refundWallet"); diff --git a/script/helperFunctions.sh b/script/helperFunctions.sh index 1a55b04e9..55ec81bfa 100755 --- a/script/helperFunctions.sh +++ b/script/helperFunctions.sh @@ -1426,18 +1426,15 @@ function verifyContract() { if [ "$ARGS" = "0x" ]; then # only show output if DEBUG flag is activated if [[ "$DEBUG" == *"true"* ]]; then - if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; 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}" - 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" || $NETWORK == "abstract" ]]; 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 @@ -1448,7 +1445,6 @@ function verifyContract() { else # only show output if DEBUG flag is activated if [[ "$DEBUG" == *"true"* ]]; then - if [[ $NETWORK == "zksync" || $NETWORK == "abstract" ]]; 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}" @@ -1456,7 +1452,6 @@ function verifyContract() { 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" || $NETWORK == "abstract" ]]; 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 From a8fb85558dc53d12661b10457a42b414a40d2228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Wed, 5 Feb 2025 17:32:54 +0700 Subject: [PATCH 26/26] fix deploy log --- deployments/_deployments_log_file.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index e05dc7c0a..78989027c 100644 --- a/deployments/_deployments_log_file.json +++ b/deployments/_deployments_log_file.json @@ -28105,7 +28105,9 @@ "ADDRESS": "0x52c10d81CcfF1DE7c510e0BA26ECaD66816e1e8D", "OPTIMIZER_RUNS": "1000000", "TIMESTAMP": "2025-01-14 16:32:35", - "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef" + "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef", + "SALT": "", + "VERIFIED": "true" } ] }