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" } } diff --git a/deployments/_deployments_log_file.json b/deployments/_deployments_log_file.json index 0fdb1e9f9..78989027c 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": { @@ -28079,7 +28107,7 @@ "TIMESTAMP": "2025-01-14 16:32:35", "CONSTRUCTOR_ARGS": "0x000000000000000000000000634e831ce6d460c2cd5067af98d6452eb280e374000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef", "SALT": "", - "VERIFIED": true + "VERIFIED": "true" } ] } diff --git a/deployments/abstract.diamond.json b/deployments/abstract.diamond.json index 5d9d00052..8a6d2dc30 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,11 +74,11 @@ "LiFiDEXAggregator": "0xFC863E1418C0C5935e7Bd9C8f3129Aa0442153DF", "LiFuelFeeCollector": "", "Permit2Proxy": "", - "ReceiverAcrossV3": "", "Receiver": "0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A", + "ReceiverAcrossV3": "", "ReceiverStargateV2": "0x83D2B4f5834d7aDE97E5837781ecfC99D9Cbe004", "RelayerCelerIM": "", "TokenWrapper": "0x527868EDbF533C3Ac540f4457405f701D9d4c7c1" } } -} \ No newline at end of file +} diff --git a/deployments/abstract.json b/deployments/abstract.json index 29a421568..1e04aa772 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" } 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" 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/deploySingleContract.sh b/script/deploy/deploySingleContract.sh index fbccb1d87..c070381b1 100755 --- a/script/deploy/deploySingleContract.sh +++ b/script/deploy/deploySingleContract.sh @@ -90,6 +90,8 @@ deploySingleContract() { echo "" fi + FILE_EXTENSION=".s.sol" + # Handle ZkSync and Abstract # We need to use zksync specific scripts that are able to be compiled for # the zkvm diff --git a/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol b/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol index 2b2bd94af..c579ad0ef 100644 --- a/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol +++ b/script/deploy/zksync/DeployLiFiDEXAggregator.zksync.s.sol @@ -29,7 +29,6 @@ contract DeployScript is DeployScriptBase { priviledgedUsers[0] = json.readAddress(".pauserWallet"); // the original RouteProcessor4.sol is also deployed with address(0) for _bentoBox - address refundWalletAddress = json.readAddress(".refundWallet"); return abi.encode(address(0), priviledgedUsers, refundWalletAddress); diff --git a/script/deploy/zksync/DeploySymbiosisFacet.zksync.s.sol b/script/deploy/zksync/DeploySymbiosisFacet.zksync.s.sol new file mode 100644 index 000000000..980d786f9 --- /dev/null +++ b/script/deploy/zksync/DeploySymbiosisFacet.zksync.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); + } +} 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() {