From 6e59fc67a9937aa01f2d918932c208db9cd01090 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Fri, 20 Sep 2024 09:22:01 -0500 Subject: [PATCH] feat: add zksync market [skip cypress] (#2162) Co-authored-by: Harsh Pandey --- package.json | 2 +- public/icons/networks/zksync.svg | 2 +- public/icons/tokens/zk.svg | 1 + src/ui-config/governanceConfig.ts | 3 ++- src/ui-config/marketsConfig.tsx | 18 ++++++++++++++++++ src/ui-config/networksConfig.ts | 15 ++++++--------- src/ui-config/permitConfig.ts | 6 ++++++ yarn.lock | 8 ++++---- 8 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 public/icons/tokens/zk.svg diff --git a/package.json b/package.json index 79aa373479..f97443c7ce 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "dependencies": { "@aave/contract-helpers": "1.30.2", "@aave/math-utils": "1.30.2", - "@bgd-labs/aave-address-book": "^3.2.1", + "@bgd-labs/aave-address-book": "^3.4.0", "@emotion/cache": "11.10.3", "@emotion/react": "11.10.4", "@emotion/server": "latest", diff --git a/public/icons/networks/zksync.svg b/public/icons/networks/zksync.svg index 2ae9452deb..422a8771c9 100644 --- a/public/icons/networks/zksync.svg +++ b/public/icons/networks/zksync.svg @@ -1 +1 @@ - + diff --git a/public/icons/tokens/zk.svg b/public/icons/tokens/zk.svg new file mode 100644 index 0000000000..059c8fec5c --- /dev/null +++ b/public/icons/tokens/zk.svg @@ -0,0 +1 @@ + diff --git a/src/ui-config/governanceConfig.ts b/src/ui-config/governanceConfig.ts index bb3397daf1..4b0ad0a4bd 100644 --- a/src/ui-config/governanceConfig.ts +++ b/src/ui-config/governanceConfig.ts @@ -12,6 +12,7 @@ import { GovernanceV3Optimism, GovernanceV3Polygon, GovernanceV3Scroll, + GovernanceV3ZkSync, } from '@bgd-labs/aave-address-book'; export const ipfsGateway = 'https://cloudflare-ipfs.com/ipfs'; @@ -134,7 +135,7 @@ export const governanceChainConfig: GovernanceChainConfig = { [ChainId.metis_andromeda]: GovernanceV3Metis.PC_DATA_HELPER, [ChainId.bnb]: GovernanceV3BNB.PC_DATA_HELPER, [ChainId.scroll]: GovernanceV3Scroll.PC_DATA_HELPER, - [324]: '0xe28A3235DCF1Acb8397B546bd588bAAFD7081505', + [ChainId.zksync]: GovernanceV3ZkSync.PC_DATA_HELPER, }, votingAssets: { aaveTokenAddress: AaveV3Ethereum.ASSETS.AAVE.UNDERLYING, diff --git a/src/ui-config/marketsConfig.tsx b/src/ui-config/marketsConfig.tsx index 446ee42a80..3f4fc49168 100644 --- a/src/ui-config/marketsConfig.tsx +++ b/src/ui-config/marketsConfig.tsx @@ -26,6 +26,7 @@ import { AaveV3Scroll, AaveV3ScrollSepolia, AaveV3Sepolia, + AaveV3ZkSync, } from '@bgd-labs/aave-address-book'; import { ReactNode } from 'react'; @@ -98,6 +99,7 @@ export enum CustomMarket { proto_bnb_v3 = 'proto_bnb_v3', proto_scroll_v3 = 'proto_scroll_v3', proto_lido_v3 = 'proto_lido_v3', + proto_zksync_v3 = 'proto_zksync_v3', proto_etherfi_v3 = 'proto_etherfi_v3', // v2 proto_mainnet = 'proto_mainnet', @@ -740,4 +742,20 @@ export const marketsData: { COLLECTOR: AaveV3Scroll.COLLECTOR, }, }, + [CustomMarket.proto_zksync_v3]: { + marketTitle: 'ZKsync', + market: CustomMarket.proto_zksync_v3, + chainId: ChainId.zksync, + v3: true, + subgraphUrl: `https://gateway-arbitrum.network.thegraph.com/api/${apiKey}/subgraphs/id/ENYSc8G3WvrbhWH8UZHrqPWYRcuyCaNmaTmoVp7uzabM`, + addresses: { + LENDING_POOL_ADDRESS_PROVIDER: AaveV3ZkSync.POOL_ADDRESSES_PROVIDER, + LENDING_POOL: AaveV3ZkSync.POOL, + WETH_GATEWAY: AaveV3ZkSync.WETH_GATEWAY, + WALLET_BALANCE_PROVIDER: AaveV3ZkSync.WALLET_BALANCE_PROVIDER, + UI_POOL_DATA_PROVIDER: AaveV3ZkSync.UI_POOL_DATA_PROVIDER, + UI_INCENTIVE_DATA_PROVIDER: AaveV3ZkSync.UI_INCENTIVE_DATA_PROVIDER, + COLLECTOR: AaveV3ZkSync.COLLECTOR, + }, + }, } as const; diff --git a/src/ui-config/networksConfig.ts b/src/ui-config/networksConfig.ts index aa04ea96ba..37b2791501 100644 --- a/src/ui-config/networksConfig.ts +++ b/src/ui-config/networksConfig.ts @@ -432,7 +432,6 @@ export const networkConfigs: Record = { }, ratesHistoryApiUrl, }, - [ChainId.scroll]: { name: 'Scroll', // privateJsonRPCUrl: 'https://scroll-mainnet.rpc.grove.city/v1/62b3314e123e6f00397f19ca', @@ -450,20 +449,18 @@ export const networkConfigs: Record = { }, ratesHistoryApiUrl, }, - [324]: { - name: 'ZkSync', - // privateJsonRPCUrl: 'https://scroll-mainnet.rpc.grove.city/v1/62b3314e123e6f00397f19ca', - publicJsonRPCUrl: ['https://1rpc.io/zksync2-era', 'https://zksync.drpc.org'], - publicJsonRPCWSUrl: 'wss://zksync.drpc.org', + [ChainId.zksync]: { + name: 'ZKsync', + privateJsonRPCUrl: 'https://zksync-mainnet.g.alchemy.com/v2/GyNpZOF5T0issE8wYgXXR_KJjUp-yds0', + publicJsonRPCUrl: ['https://mainnet.era.zksync.io'], baseAssetSymbol: 'ETH', wrappedBaseAssetSymbol: 'WETH', baseAssetDecimals: 18, - explorerLink: 'https://explorer.zksync.io/', - isTestnet: false, + explorerLink: 'https://era.zksync.network/', networkLogoPath: '/icons/networks/zksync.svg', bridge: { icon: '/icons/networks/zksync.svg', - name: 'Zksync Bridge', + name: 'ZKsync Bridge', url: 'https://portal.zksync.io/bridge/', }, ratesHistoryApiUrl, diff --git a/src/ui-config/permitConfig.ts b/src/ui-config/permitConfig.ts index 6868a0c672..5bb71529a2 100644 --- a/src/ui-config/permitConfig.ts +++ b/src/ui-config/permitConfig.ts @@ -45,4 +45,10 @@ export const permitByChainAndToken: { [ChainId.optimism]: { '0x76fb31fb4af56892a25e32cfc43de717950c9278': false, // aave }, + [ChainId.zksync]: { + '0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e': true, + '0x703b52f2b28febcb60e1372858af5b18849fe867': true, + '0x493257fd37edb34451f62edf8d2a0c418852ba4c': true, + '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91': true, + }, }; diff --git a/yarn.lock b/yarn.lock index 3546e065f4..12d61d80e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1317,10 +1317,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bgd-labs/aave-address-book@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-3.2.1.tgz#9ecdb92303170e754e048d25f7d6cd27312c530b" - integrity sha512-IlXHWYAhcgbiteTU50I6v8Awl7PBAHfXGz2IyjR5MPXy4xvW4UXYKbCRUtOCFxY/sdLtu/Gb+GgypyF76sd4Qg== +"@bgd-labs/aave-address-book@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-3.4.0.tgz#e139ffbb01eea7b51ea5b162e45a9b28e41d74bc" + integrity sha512-0msSmy6tF///f062FheaafONO2niOeWvD0nychrxMVXojcX+obM7g8Ad0+JjSfxmKoGxAYKGER7zF7WbBEz6nw== "@coinbase/wallet-sdk@3.1.0", "@coinbase/wallet-sdk@^3.0.4": version "3.1.0"