From 9cd39edd4771a3817a05c417d1da3610790d4106 Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:04:11 -0700 Subject: [PATCH] feat(sdk-core): support zksync on V3 (#34) ## Description We have deployed V3 to to ZkSync. We are updating the SDKs to support V3 in FE and BE. First step is to update sdk-core ## How Has This Been Tested? unit tests ## Are there any breaking changes? No ## (Optional) Feedback Focus No ## (Optional) Follow Ups We will have to create v2-sdk and v3-sdk and universal-router-sdk changes separately, because we still publish individual sdk packages to npm repo. --- sdks/sdk-core/src/addresses.ts | 11 +++++++++++ sdks/sdk-core/src/chains.ts | 2 ++ 2 files changed, 13 insertions(+) diff --git a/sdks/sdk-core/src/addresses.ts b/sdks/sdk-core/src/addresses.ts index 76602493e..ebbdec7fb 100644 --- a/sdks/sdk-core/src/addresses.ts +++ b/sdks/sdk-core/src/addresses.ts @@ -236,6 +236,16 @@ const BLAST_ADDRESSES: ChainAddresses = { swapRouter02Address: '0x549FEB8c9bd4c12Ad2AB27022dA12492aC452B66', } +const ZKSYNC_ADDRESSES: ChainAddresses = { + v3CoreFactoryAddress: '0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422', + multicallAddress: '0x0c68a7C72f074d1c45C16d41fa74eEbC6D16a65C', + quoterAddress: '0x8Cb537fc92E26d8EBBb760E632c95484b6Ea3e28', + v3MigratorAddress: '0x611841b24E43C4ACfd290B427a3D6cf1A59dac8E', + nonfungiblePositionManagerAddress: '0x0616e5762c1E7Dc3723c50663dF10a162D690a86', + tickLensAddress: '0xe10FF11b809f8EE07b056B452c3B2caa7FE24f89', + swapRouter02Address: '0x99c56385daBCE3E81d8499d0b8d0257aBC07E8A3', +} + export const CHAIN_TO_ADDRESSES_MAP: Record = { [ChainId.MAINNET]: MAINNET_ADDRESSES, [ChainId.OPTIMISM]: OPTIMISM_ADDRESSES, @@ -258,6 +268,7 @@ export const CHAIN_TO_ADDRESSES_MAP: Record [ChainId.ZORA_SEPOLIA]: ZORA_SEPOLIA_ADDRESSES, [ChainId.ROOTSTOCK]: ROOTSTOCK_ADDRESSES, [ChainId.BLAST]: BLAST_ADDRESSES, + [ChainId.ZKSYNC]: ZKSYNC_ADDRESSES, } /* V3 Contract Addresses */ diff --git a/sdks/sdk-core/src/chains.ts b/sdks/sdk-core/src/chains.ts index 33246d054..22cc5453e 100644 --- a/sdks/sdk-core/src/chains.ts +++ b/sdks/sdk-core/src/chains.ts @@ -22,6 +22,7 @@ export enum ChainId { ZORA_SEPOLIA = 999999999, ROOTSTOCK = 30, BLAST = 81457, + ZKSYNC = 324, } export const SUPPORTED_CHAINS = [ @@ -46,6 +47,7 @@ export const SUPPORTED_CHAINS = [ ChainId.ZORA_SEPOLIA, ChainId.ROOTSTOCK, ChainId.BLAST, + ChainId.ZKSYNC, ] as const export type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number]