Skip to content

Commit

Permalink
feat: add zksync market [skip cypress] (#2162)
Browse files Browse the repository at this point in the history
Co-authored-by: Harsh Pandey <[email protected]>
  • Loading branch information
grothem and brotherlymite authored Sep 20, 2024
1 parent fc7345d commit 6e59fc6
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion public/icons/networks/zksync.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/tokens/zk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/ui-config/governanceConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
GovernanceV3Optimism,
GovernanceV3Polygon,
GovernanceV3Scroll,
GovernanceV3ZkSync,
} from '@bgd-labs/aave-address-book';

export const ipfsGateway = 'https://cloudflare-ipfs.com/ipfs';
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 18 additions & 0 deletions src/ui-config/marketsConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
AaveV3Scroll,
AaveV3ScrollSepolia,
AaveV3Sepolia,
AaveV3ZkSync,
} from '@bgd-labs/aave-address-book';
import { ReactNode } from 'react';

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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;
15 changes: 6 additions & 9 deletions src/ui-config/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
},
ratesHistoryApiUrl,
},

[ChainId.scroll]: {
name: 'Scroll',
// privateJsonRPCUrl: 'https://scroll-mainnet.rpc.grove.city/v1/62b3314e123e6f00397f19ca',
Expand All @@ -450,20 +449,18 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
},
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,
Expand Down
6 changes: 6 additions & 0 deletions src/ui-config/permitConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ export const permitByChainAndToken: {
[ChainId.optimism]: {
'0x76fb31fb4af56892a25e32cfc43de717950c9278': false, // aave
},
[ChainId.zksync]: {
'0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e': true,
'0x703b52f2b28febcb60e1372858af5b18849fe867': true,
'0x493257fd37edb34451f62edf8d2a0c418852ba4c': true,
'0x5aea5775959fbc2557cc8789bc1bf90a239d9a91': true,
},
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]", "@coinbase/wallet-sdk@^3.0.4":
version "3.1.0"
Expand Down

2 comments on commit 6e59fc6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.