From 2e27036ed46108812a883f16cb7096b7a5c6113a Mon Sep 17 00:00:00 2001 From: Mark Hinschberger Date: Tue, 7 Nov 2023 04:18:31 -0500 Subject: [PATCH] feat: gnosis market [skip cypress] (#1826) Co-authored-by: Mark Grothe --- package.json | 2 +- public/icons/networks/gnosis.svg | 1 + public/icons/tokens/eure.svg | 1 + public/icons/tokens/gno.svg | 1 + public/icons/tokens/gnosissdai.svg | 1 + public/icons/tokens/wxdai.svg | 1 + public/icons/tokens/xdai.svg | 1 + src/ui-config/marketsConfig.tsx | 18 +++++++++++++++++- src/ui-config/networksConfig.ts | 21 +++++++++++++++++++++ src/ui-config/reservePatches.ts | 5 +++++ yarn.lock | 8 ++++---- 11 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 public/icons/networks/gnosis.svg create mode 100644 public/icons/tokens/eure.svg create mode 100644 public/icons/tokens/gno.svg create mode 100644 public/icons/tokens/gnosissdai.svg create mode 100644 public/icons/tokens/wxdai.svg create mode 100644 public/icons/tokens/xdai.svg diff --git a/package.json b/package.json index ffcd8cd540..fe05e6314c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "@aave/contract-helpers": "1.21.0", "@aave/math-utils": "^1.21.0", - "@bgd-labs/aave-address-book": "^2.7.0", + "@bgd-labs/aave-address-book": "^2.10.0", "@emotion/cache": "11.10.3", "@emotion/react": "11.10.4", "@emotion/server": "latest", diff --git a/public/icons/networks/gnosis.svg b/public/icons/networks/gnosis.svg new file mode 100644 index 0000000000..c200b3ee10 --- /dev/null +++ b/public/icons/networks/gnosis.svg @@ -0,0 +1 @@ + diff --git a/public/icons/tokens/eure.svg b/public/icons/tokens/eure.svg new file mode 100644 index 0000000000..f299a426c0 --- /dev/null +++ b/public/icons/tokens/eure.svg @@ -0,0 +1 @@ + diff --git a/public/icons/tokens/gno.svg b/public/icons/tokens/gno.svg new file mode 100644 index 0000000000..72a675bfbf --- /dev/null +++ b/public/icons/tokens/gno.svg @@ -0,0 +1 @@ + diff --git a/public/icons/tokens/gnosissdai.svg b/public/icons/tokens/gnosissdai.svg new file mode 100644 index 0000000000..3debf3df1a --- /dev/null +++ b/public/icons/tokens/gnosissdai.svg @@ -0,0 +1 @@ + diff --git a/public/icons/tokens/wxdai.svg b/public/icons/tokens/wxdai.svg new file mode 100644 index 0000000000..3bf4ef39d8 --- /dev/null +++ b/public/icons/tokens/wxdai.svg @@ -0,0 +1 @@ + diff --git a/public/icons/tokens/xdai.svg b/public/icons/tokens/xdai.svg new file mode 100644 index 0000000000..6e2f70906b --- /dev/null +++ b/public/icons/tokens/xdai.svg @@ -0,0 +1 @@ + diff --git a/src/ui-config/marketsConfig.tsx b/src/ui-config/marketsConfig.tsx index 0fd779afe8..dc6a38ffc6 100644 --- a/src/ui-config/marketsConfig.tsx +++ b/src/ui-config/marketsConfig.tsx @@ -15,6 +15,7 @@ import { AaveV3Fantom, AaveV3FantomTestnet, AaveV3Fuji, + AaveV3Gnosis, AaveV3Harmony, AaveV3Metis, AaveV3Mumbai, @@ -78,7 +79,6 @@ export type MarketDataType = { marketName: string; }; }; - export enum CustomMarket { // v3 test networks, all v3.0.1 proto_arbitrum_goerli_v3 = 'proto_arbitrum_goerli_v3', @@ -98,6 +98,7 @@ export enum CustomMarket { proto_arbitrum_v3 = 'proto_arbitrum_v3', proto_metis_v3 = 'proto_metis_v3', proto_base_v3 = 'proto_base_v3', + proto_gnosis_v3 = 'proto_gnosis_v3', // v2 proto_mainnet = 'proto_mainnet', proto_avalanche = 'proto_avalanche', @@ -679,4 +680,19 @@ export const marketsData: { marketName: 'polygon', }, }, + [CustomMarket.proto_gnosis_v3]: { + marketTitle: 'Gnosis', + chainId: ChainId.xdai, + v3: true, + // subgraphUrl: '', + addresses: { + LENDING_POOL_ADDRESS_PROVIDER: AaveV3Gnosis.POOL_ADDRESSES_PROVIDER, + LENDING_POOL: AaveV3Gnosis.POOL, + WETH_GATEWAY: AaveV3Gnosis.WETH_GATEWAY, + WALLET_BALANCE_PROVIDER: AaveV3Gnosis.WALLET_BALANCE_PROVIDER, + UI_POOL_DATA_PROVIDER: AaveV3Gnosis.UI_POOL_DATA_PROVIDER, + UI_INCENTIVE_DATA_PROVIDER: AaveV3Gnosis.UI_INCENTIVE_DATA_PROVIDER, + COLLECTOR: AaveV3Gnosis.COLLECTOR, + }, + }, } as const; diff --git a/src/ui-config/networksConfig.ts b/src/ui-config/networksConfig.ts index 140a89aa75..b93991665a 100644 --- a/src/ui-config/networksConfig.ts +++ b/src/ui-config/networksConfig.ts @@ -413,4 +413,25 @@ export const networkConfigs: Record = { explorerLink: 'https://andromeda-explorer.metis.io', networkLogoPath: '/icons/networks/metis.svg', }, + + [ChainId.xdai]: { + name: 'Gnosis Chain', + privateJsonRPCUrl: + 'https://gnosischain-mainnet.gateway.pokt.network/v1/lb/62b3314e123e6f00397f19ca', + + publicJsonRPCUrl: ['https://rpc.ankr.com/gnosis', 'https://rpc.gnosischain.com'], + publicJsonRPCWSUrl: 'wss://rpc.gnosischain.com/wss', + baseUniswapAdapter: '0x0', + baseAssetSymbol: 'xDAI', + wrappedBaseAssetSymbol: 'WXDAI', + baseAssetDecimals: 18, + explorerLink: 'https://gnosisscan.io', + isTestnet: false, + networkLogoPath: '/icons/networks/gnosis.svg', + bridge: { + icon: '/icons/networks/gnosis.svg', + name: 'xDai Bridge', + url: 'https://bridge.gnosischain.com/', + }, + }, } as const; diff --git a/src/ui-config/reservePatches.ts b/src/ui-config/reservePatches.ts index 1446cd3b38..848ce07fd9 100644 --- a/src/ui-config/reservePatches.ts +++ b/src/ui-config/reservePatches.ts @@ -108,6 +108,11 @@ export function fetchIconSymbolAndName({ underlyingAsset, symbol, name }: IconSy symbol: 'USDC.e', iconSymbol: 'USDC', }, + '0xaf204776c7245bf4147c2612bf6e5972ee483701': { + name: 'Savings xDAI', + symbol: 'sDAI', + iconSymbol: 'gnosissdai', + }, '0xa693B19d2931d498c5B318dF961919BB4aee87a5': { iconSymbol: 'UST', name: 'UST (Wormhole)' }, '0x59a19d8c652fa0284f44113d0ff9aba70bd46fb4': { iconSymbol: 'BPT_BAL_WETH' }, '0x1eff8af5d577060ba4ac8a29a13525bb0ee2a3d5': { iconSymbol: 'BPT_WBTC_WETH' }, diff --git a/yarn.lock b/yarn.lock index 259a8d8664..fdb0d54e04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1328,10 +1328,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bgd-labs/aave-address-book@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.7.0.tgz#ae26abb1a340fe795b9a2febd87f842c2ed06a99" - integrity sha512-TYErogNQIecHnnr7NXxGSnr1d/QuXNP9o5L8wRzx0+GIJiCi7Dmy9dlJxQO/nEky/Nq512l09xYKjRVnTz37Tg== +"@bgd-labs/aave-address-book@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.10.0.tgz#19873ec0edf9ee1f1a5539162e6092b0a2b2c4b4" + integrity sha512-DVglkDCYUf7etb6mnCziIY2HPgap4X3AnC/1tC0ZqpXFrhO0lQzWBiMeWy20r1x/b81iHMQa02ULaco3LhdeVw== "@coinbase/wallet-sdk@3.1.0", "@coinbase/wallet-sdk@^3.0.4": version "3.1.0"