From 77b09a7cd539f254e6227a46c19584564c5f08a0 Mon Sep 17 00:00:00 2001 From: Mark Grothe Date: Mon, 10 Feb 2025 11:08:17 -0600 Subject: [PATCH] feat: gho on base [skip cypress] (#2340) Co-authored-by: miguelmtzinf Co-authored-by: Mark Hinschberger --- package.json | 2 +- .../transactions/Bridge/BridgeConfig.ts | 69 ++++++++++++++++--- src/services/WalletBalanceService.ts | 1 + src/ui-config/TokenList.ts | 9 +++ src/ui-config/marketsConfig.tsx | 1 + yarn.lock | 8 +-- 6 files changed, 77 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 10792b3fd0..7f5aac95e3 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "dependencies": { "@aave/contract-helpers": "1.30.5", "@aave/math-utils": "1.30.5", - "@bgd-labs/aave-address-book": "4.8.1", + "@bgd-labs/aave-address-book": "4.10.0", "@emotion/cache": "11.10.3", "@emotion/react": "11.10.4", "@emotion/server": "latest", diff --git a/src/components/transactions/Bridge/BridgeConfig.ts b/src/components/transactions/Bridge/BridgeConfig.ts index 0a03c6dec8..19bfc20045 100644 --- a/src/components/transactions/Bridge/BridgeConfig.ts +++ b/src/components/transactions/Bridge/BridgeConfig.ts @@ -2,8 +2,13 @@ import { ChainId } from '@aave/contract-helpers'; import { AaveV3Arbitrum, AaveV3ArbitrumSepolia, + AaveV3Base, + AaveV3BaseSepolia, AaveV3Ethereum, AaveV3Sepolia, + GhoArbitrum, + GhoBase, + GhoEthereum, } from '@bgd-labs/aave-address-book'; import { constants } from 'ethers'; import { TokenInfoWithBalance } from 'src/hooks/generic/useTokensBalance'; @@ -39,9 +44,9 @@ const prodConfig: Config[] = [ { sourceChainId: ChainId.mainnet, chainSelector: '5009297550715157269', - lockReleaseTokenPool: '0x06179f7C1be40863405f374E7f5F8806c728660A', // TODO: address book + lockReleaseTokenPool: GhoEthereum.GHO_CCIP_TOKEN_POOL, router: '0x80226fc0ee2b096224eeac085bb9a8cba1146f7d', - tokenOracle: '0x3f12643d3f6f874d39c2a4c9f2cd6f2dbac877fc', + tokenOracle: '0x3f12643d3f6f874d39c2a4c9f2cd6f2dbac877fc', // CL Feed wrappedNativeOracle: AaveV3Ethereum.ASSETS.WETH.ORACLE, subgraphUrl: `https://gateway-arbitrum.network.thegraph.com/api/${process.env.NEXT_PUBLIC_SUBGRAPH_API_KEY}/subgraphs/id/E11p8T4Ff1DHZbwSUC527hkUb5innVMdTuP6A2s1xtm1`, feeTokens: [ @@ -50,7 +55,7 @@ const prodConfig: Config[] = [ address: AaveV3Ethereum.ASSETS.GHO.UNDERLYING, symbol: 'GHO', decimals: 18, - chainId: 1, + chainId: ChainId.mainnet, logoURI: 'https://assets.coingecko.com/coins/images/30663/standard/gho-token-logo.png?1720517092', oracle: AaveV3Ethereum.ASSETS.GHO.ORACLE, @@ -64,7 +69,7 @@ const prodConfig: Config[] = [ symbol: 'ETH', decimals: 18, address: constants.AddressZero, // Use zero address for network token ccip - chainId: 1, + chainId: ChainId.mainnet, logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', extensions: { @@ -77,9 +82,9 @@ const prodConfig: Config[] = [ { sourceChainId: ChainId.arbitrum_one, chainSelector: '4949039107694359620', - burnMintTokenPool: '0xB94Ab28c6869466a46a42abA834ca2B3cECCA5eB', // TODO: address book + burnMintTokenPool: GhoArbitrum.GHO_CCIP_TOKEN_POOL, router: '0x141fa059441e0ca23ce184b6a78bafd2a517dde8', - tokenOracle: '0xb05984ad83c20b3ade7bf97a9a0cb539dde28dbb', + tokenOracle: AaveV3Arbitrum.ASSETS.GHO.ORACLE, wrappedNativeOracle: AaveV3Arbitrum.ASSETS.WETH.ORACLE, subgraphUrl: `https://gateway-arbitrum.network.thegraph.com/api/${process.env.NEXT_PUBLIC_SUBGRAPH_API_KEY}/subgraphs/id/GPpZfiGoDChLsiWoMG5fxXdRNEYrsVDrKJ39moGcbz6i`, feeTokens: [ @@ -88,7 +93,7 @@ const prodConfig: Config[] = [ address: AaveV3Arbitrum.ASSETS.GHO.UNDERLYING, symbol: 'GHO', decimals: 18, - chainId: 42161, + chainId: ChainId.arbitrum_one, logoURI: 'https://assets.coingecko.com/coins/images/30663/standard/gho-token-logo.png?1720517092', oracle: AaveV3Arbitrum.ASSETS.GHO.ORACLE, @@ -102,7 +107,31 @@ const prodConfig: Config[] = [ symbol: 'ETH', decimals: 18, address: constants.AddressZero, // Use zero address for network token ccip - chainId: 42161, // Arb + chainId: ChainId.arbitrum_one, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', + extensions: { + isNative: true, + }, + balance: '0', + }, + ], + }, + { + sourceChainId: ChainId.base, + chainSelector: '15971525489660198786', + burnMintTokenPool: GhoBase.GHO_CCIP_TOKEN_POOL, + router: '0x881e3A65B4d4a04dD529061dd0071cf975F58bCD', + tokenOracle: '0x42868EFcee13C0E71af89c04fF7d96f5bec479b0', + wrappedNativeOracle: AaveV3Base.ASSETS.WETH.ORACLE, + subgraphUrl: `https://gateway.thegraph.com/api/${process.env.NEXT_PUBLIC_SUBGRAPH_API_KEY}/subgraphs/id/7RqaLvSMWBv4Z3xmv4kb6Jq3t59ikYG3wpcsTnLgBWzt`, + feeTokens: [ + { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + address: constants.AddressZero, // Use zero address for network token ccip + chainId: ChainId.base, logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', extensions: { @@ -191,6 +220,30 @@ const testnetConfig: Config[] = [ }, ], }, + { + sourceChainId: ChainId.base_sepolia, + burnMintTokenPool: '0x2a33945f942913b730aB36A24150A96c3D0CC9E9', + chainSelector: '10344971235874465080', + router: '0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93', + tokenOracle: '0xFD5ea2e57CDC98D371D8eA899d1F2C24bfFb39BD', + wrappedNativeOracle: AaveV3BaseSepolia.ASSETS.WETH.ORACLE, + subgraphUrl: `https://gateway.thegraph.com/api/${process.env.NEXT_PUBLIC_SUBGRAPH_API_KEY}/subgraphs/id/8bpqvL6XBCVhN4heE9rdEwgTketeZ2U5vVGEh5fDoUEH`, + feeTokens: [ + { + name: 'Ethereum', + symbol: 'ETH', + decimals: 18, + address: constants.AddressZero, + chainId: ChainId.base_sepolia, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', + extensions: { + isNative: true, + }, + balance: '0', + }, + ], + }, ]; export const laneConfig = ENABLE_TESTNET ? testnetConfig : prodConfig; diff --git a/src/services/WalletBalanceService.ts b/src/services/WalletBalanceService.ts index 402bbffcf3..a0183fbee3 100644 --- a/src/services/WalletBalanceService.ts +++ b/src/services/WalletBalanceService.ts @@ -90,6 +90,7 @@ export class WalletBalanceService { marketData.chainId, marketData.addresses.WALLET_BALANCE_PROVIDER ); + const balances = await walletBalanceService.batchBalanceOf( [user], [marketData.addresses.GHO_TOKEN_ADDRESS?.toLowerCase() as string] // GHO UNDERLYING diff --git a/src/ui-config/TokenList.ts b/src/ui-config/TokenList.ts index 18c7af5ba7..e431c2c039 100644 --- a/src/ui-config/TokenList.ts +++ b/src/ui-config/TokenList.ts @@ -12723,6 +12723,15 @@ export const TOKEN_LIST: TokenList = { logoURI: 'https://assets.coingecko.com/coins/images/30663/standard/gho-token-logo.png?1720517092', }, + { + name: 'Gho Token', + address: '0x6bb7a212910682dcfdbd5bcbb3e28fb4e8da10ee', + symbol: 'GHO', + decimals: 18, + chainId: 8453, + logoURI: + 'https://assets.coingecko.com/coins/images/30663/standard/gho-token-logo.png?1720517092', + }, { name: 'stk GHO', address: '0x1a88Df1cFe15Af22B3c4c783D4e6F7F9e0C1885d', diff --git a/src/ui-config/marketsConfig.tsx b/src/ui-config/marketsConfig.tsx index e8b59bf4a4..899bf0f0f7 100644 --- a/src/ui-config/marketsConfig.tsx +++ b/src/ui-config/marketsConfig.tsx @@ -350,6 +350,7 @@ export const marketsData: { SWAP_COLLATERAL_ADAPTER: AaveV3Base.SWAP_COLLATERAL_ADAPTER, WITHDRAW_SWITCH_ADAPTER: AaveV3Base.WITHDRAW_SWAP_ADAPTER, DEBT_SWITCH_ADAPTER: AaveV3Base.DEBT_SWAP_ADAPTER, + GHO_TOKEN_ADDRESS: '0x6bb7a212910682dcfdbd5bcbb3e28fb4e8da10ee', }, }, [CustomMarket.proto_arbitrum_sepolia_v3]: { diff --git a/yarn.lock b/yarn.lock index 45b0c59ee6..4d89bde038 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1066,10 +1066,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bgd-labs/aave-address-book@4.8.1": - version "4.8.1" - resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-4.8.1.tgz#3c8b97c24770df3e3e965e58932b7f0a40e3b706" - integrity sha512-t0Qz6lycoxVgoa9Jhx3t80CpZfQJD9yIH1tY22eGeN0Li2nFG9Y+XX3i3UQrzqZH613RymtyLHS4WXqVpZu4LA== +"@bgd-labs/aave-address-book@4.10.0": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-4.10.0.tgz#3df9b6afda47d779f39b78aa48c4f0982a18c6e1" + integrity sha512-+WtMRtXLFpic/PLhNn32FIFzNFIgqlgC5Z9RLOsPgbdkvDDAW83w1emoxqxbW0jYGGNcYJUTTrtXqlhDeQGwkg== "@coinbase/wallet-sdk@4.2.3": version "4.2.3"