From e7a087df955c341ff4b6bfc0e7145c913cce7bdb Mon Sep 17 00:00:00 2001 From: Gleiser Oliveira Date: Wed, 18 Dec 2024 12:26:21 -0600 Subject: [PATCH] feat: add Base mainnet --- .../src/hooks/useIsFeatureEnabled/index.tsx | 2 +- apps/evm/src/libs/contracts/config/index.ts | 40 +++++++++---------- .../tokens/infos/commonTokens/baseMainnet.ts | 33 ++++++++++++++- packages/chains/src/chainMetadata.ts | 3 +- 4 files changed, 54 insertions(+), 24 deletions(-) diff --git a/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx b/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx index 6c106c3ee7..4585dd7a35 100644 --- a/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx +++ b/apps/evm/src/hooks/useIsFeatureEnabled/index.tsx @@ -58,6 +58,7 @@ export const featureFlags = { ChainId.ZKSYNC_MAINNET, ChainId.OPTIMISM_SEPOLIA, ChainId.OPTIMISM_MAINNET, + ChainId.BASE_MAINNET, ChainId.BASE_SEPOLIA, ], isolatedPools: [ @@ -83,7 +84,6 @@ export const featureFlags = { ChainId.ZKSYNC_MAINNET, ChainId.OPTIMISM_MAINNET, ChainId.OPTIMISM_SEPOLIA, - ChainId.BASE_MAINNET, ChainId.BASE_SEPOLIA, ], wrapUnwrapNativeToken: [ diff --git a/apps/evm/src/libs/contracts/config/index.ts b/apps/evm/src/libs/contracts/config/index.ts index 59166ee441..1cd47af993 100644 --- a/apps/evm/src/libs/contracts/config/index.ts +++ b/apps/evm/src/libs/contracts/config/index.ts @@ -2,7 +2,7 @@ import { abi as OmnichainGovernanceExecutorAbi } from '@venusprotocol/governance import { abi as GovernorBravoDelegateAbi } from '@venusprotocol/governance-contracts/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.json'; import venusGovernanceArbitrumOneDeployments from '@venusprotocol/governance-contracts/deployments/arbitrumone_addresses.json'; import venusGovernanceArbitrumSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/arbitrumsepolia_addresses.json'; -// TODO: add venusGovernanceBaseMainnetDeployments +import venusGovernanceBaseMainnetDeployments from '@venusprotocol/governance-contracts/deployments/basemainnet_addresses.json'; import venusGovernanceBaseSepoliaDeployments from '@venusprotocol/governance-contracts/deployments/basesepolia_addresses.json'; import venusGovernanceBscMainnetDeployments from '@venusprotocol/governance-contracts/deployments/bscmainnet_addresses.json'; import venusGovernanceBscTestnetDeployments from '@venusprotocol/governance-contracts/deployments/bsctestnet_addresses.json'; @@ -23,7 +23,7 @@ import { abi as RewardsDistributorAbi } from '@venusprotocol/isolated-pools/arti import { abi as VBep20Abi } from '@venusprotocol/isolated-pools/artifacts/contracts/VToken.sol/VToken.json'; import isolatedPoolsArbitrumOneDeployments from '@venusprotocol/isolated-pools/deployments/arbitrumone_addresses.json'; import isolatedPoolsArbitrumSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/arbitrumsepolia_addresses.json'; -// TODO: add isolatedPoolsBaseMainnetDeployments once deployed +import isolatedPoolsBaseMainnetDeployments from '@venusprotocol/isolated-pools/deployments/basemainnet_addresses.json'; import isolatedPoolsBaseSepoliaDeployments from '@venusprotocol/isolated-pools/deployments/basesepolia_addresses.json'; import isolatedPoolsBscMainnetDeployments from '@venusprotocol/isolated-pools/deployments/bscmainnet_addresses.json'; import isolatedPoolsBscTestnetDeployments from '@venusprotocol/isolated-pools/deployments/bsctestnet_addresses.json'; @@ -55,7 +55,7 @@ import { abi as XVSProxyOFTSrc } from '@venusprotocol/token-bridge/artifacts/con import { abi as XvsTokenOmnichainAbi } from '@venusprotocol/token-bridge/artifacts/contracts/Bridge/token/XVS.sol/XVS.json'; import tokenBridgeArbitrumOneDeployments from '@venusprotocol/token-bridge/deployments/arbitrumone_addresses.json'; import tokenBridgeArbitrumSepoliaDeployments from '@venusprotocol/token-bridge/deployments/arbitrumsepolia_addresses.json'; -// TODO: add tokenBridgeBaseMainnetDeployments once deployed +import tokenBridgeBaseMainnetDeployments from '@venusprotocol/token-bridge/deployments/basemainnet_addresses.json'; import tokenBridgeBaseSepoliaDeployments from '@venusprotocol/token-bridge/deployments/basesepolia_addresses.json'; import tokenBridgeBscMainnetDeployments from '@venusprotocol/token-bridge/deployments/bscmainnet_addresses.json'; import tokenBridgeBscTestnetDeployments from '@venusprotocol/token-bridge/deployments/bsctestnet_addresses.json'; @@ -86,7 +86,7 @@ import { abi as XvsStoreAbi } from '@venusprotocol/venus-protocol/artifacts/cont import { abi as XvsVaultAbi } from '@venusprotocol/venus-protocol/artifacts/contracts/XVSVault/XVSVault.sol/XVSVault.json'; import venusProtocolArbitrumOneDeployments from '@venusprotocol/venus-protocol/deployments/arbitrumone_addresses.json'; import venusProtocolArbitrumSepoliaDeployments from '@venusprotocol/venus-protocol/deployments/arbitrumsepolia_addresses.json'; -// TODO: add venusProtocolBaseMainnetDeployments once deployed +import venusProtocolBaseMainnetDeployments from '@venusprotocol/venus-protocol/deployments/basemainnet_addresses.json'; import venusProtocolBaseSepoliaDeployments from '@venusprotocol/venus-protocol/deployments/basesepolia_addresses.json'; import venusProtocolBscMainnetDeployments from '@venusprotocol/venus-protocol/deployments/bscmainnet_addresses.json'; import venusProtocolBscTestnetDeployments from '@venusprotocol/venus-protocol/deployments/bsctestnet_addresses.json'; @@ -163,8 +163,7 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: isolatedPoolsZkSyncMainnetDeployments.addresses.PoolLens, [ChainId.OPTIMISM_SEPOLIA]: isolatedPoolsOptimismSepoliaDeployments.addresses.PoolLens, [ChainId.OPTIMISM_MAINNET]: isolatedPoolsOptimismMainnetDeployments.addresses.PoolLens, - // add BASE_MAINNET once deployed - //[ChainId.BASE_MAINNET]: isolatedPoolsBaseMainnetDeployments.addresses.PoolLens, + [ChainId.BASE_MAINNET]: isolatedPoolsBaseMainnetDeployments.addresses.PoolLens, [ChainId.BASE_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolLens, }, }, @@ -187,9 +186,7 @@ export const contracts: ContractConfig[] = [ isolatedPoolsOptimismSepoliaDeployments.addresses.PoolRegistry_Proxy, [ChainId.OPTIMISM_MAINNET]: isolatedPoolsOptimismMainnetDeployments.addresses.PoolRegistry_Proxy, - // add BASE_MAINNET once deployed - // [ChainId.BASE_MAINNET]: - // isolatedPoolsBaseMainnetDeployments.addresses.PoolRegistry_Proxy, + [ChainId.BASE_MAINNET]: isolatedPoolsBaseMainnetDeployments.addresses.PoolRegistry_Proxy, [ChainId.BASE_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolRegistry_Proxy, }, }, @@ -231,8 +228,7 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: tokenBridgeZkSyncMainnetDeployments.addresses.XVS, [ChainId.OPTIMISM_SEPOLIA]: tokenBridgeOptimismSepoliaDeployments.addresses.XVS, [ChainId.OPTIMISM_MAINNET]: tokenBridgeOptimismMainnetDeployments.addresses.XVS, - // add BASE_MAINNET once deployed - // [ChainId.BASE_MAINNET]: , + [ChainId.BASE_MAINNET]: tokenBridgeBaseMainnetDeployments.addresses.XVS, [ChainId.BASE_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVS, }, }, @@ -252,8 +248,7 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.XVSVaultProxy, [ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.XVSVaultProxy, [ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.XVSVaultProxy, - // add BASE_MAINNET once deployed - // [ChainId.BASE_MAINNET]: , + [ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.XVSVaultProxy, [ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSVaultProxy, }, }, @@ -273,8 +268,7 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.XVSStore, [ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.XVSStore, [ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.XVSStore, - // TODO: add BASE_MAINNET once deployed - // [ChainId.BASE_MAINNET]: , + [ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.XVSStore, [ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSStore, }, }, @@ -310,9 +304,8 @@ export const contracts: ContractConfig[] = [ venusGovernanceOptimismMainnetDeployments.addresses.OmnichainGovernanceExecutor, [ChainId.OPTIMISM_SEPOLIA]: venusGovernanceOptimismSepoliaDeployments.addresses.OmnichainGovernanceExecutor, - // TODO: add BASE_MAINNET once deployed - // [ChainId.BASE_MAINNET]: - // , + [ChainId.BASE_MAINNET]: + venusGovernanceBaseMainnetDeployments.addresses.OmnichainGovernanceExecutor, [ChainId.BASE_SEPOLIA]: venusGovernanceBaseSepoliaDeployments.addresses.OmnichainGovernanceExecutor, }, @@ -415,6 +408,8 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.Prime, [ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.Prime, [ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.Prime, + [ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.Prime, + [ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.Prime, }, }, { @@ -439,6 +434,8 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.VTreasuryV8, [ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.VTreasuryV8, [ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.VTreasuryV8, + [ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.VTreasuryV8, + [ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.VTreasuryV8, }, }, { @@ -455,7 +452,7 @@ export const contracts: ContractConfig[] = [ [ChainId.ZKSYNC_MAINNET]: tokenBridgeZkSyncMainnetDeployments.addresses.XVSProxyOFTDest, [ChainId.OPTIMISM_SEPOLIA]: tokenBridgeOptimismSepoliaDeployments.addresses.XVSProxyOFTDest, [ChainId.OPTIMISM_MAINNET]: tokenBridgeOptimismMainnetDeployments.addresses.XVSProxyOFTDest, - // TODO: add BASE_MAINNET once deployed + [ChainId.BASE_MAINNET]: tokenBridgeBaseSepoliaDeployments.addresses.XVSProxyOFTDest, [ChainId.BASE_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVSProxyOFTDest, }, }, @@ -641,7 +638,10 @@ export const contracts: ContractConfig[] = [ [isolatedPoolsOptimismSepoliaDeployments.addresses.Comptroller_Core.toLowerCase()]: isolatedPoolsOptimismSepoliaDeployments.addresses.NativeTokenGateway_vWETH_Core, }, - [ChainId.BASE_MAINNET]: {}, + [ChainId.BASE_MAINNET]: { + [isolatedPoolsBaseMainnetDeployments.addresses.Comptroller_Core.toLowerCase()]: + isolatedPoolsBaseMainnetDeployments.addresses.NativeTokenGateway_vWETH_Core, + }, [ChainId.BASE_SEPOLIA]: { [isolatedPoolsBaseSepoliaDeployments.addresses.Comptroller_Core.toLowerCase()]: isolatedPoolsBaseSepoliaDeployments.addresses.NativeTokenGateway_vWETH_Core, diff --git a/apps/evm/src/libs/tokens/infos/commonTokens/baseMainnet.ts b/apps/evm/src/libs/tokens/infos/commonTokens/baseMainnet.ts index 83ba1f61f2..ad4a62927b 100644 --- a/apps/evm/src/libs/tokens/infos/commonTokens/baseMainnet.ts +++ b/apps/evm/src/libs/tokens/infos/commonTokens/baseMainnet.ts @@ -1,5 +1,9 @@ import { NATIVE_TOKEN_ADDRESS } from 'constants/address'; +import cbbtcLogo from 'libs/tokens/img/cbbtc.svg'; import ethLogo from 'libs/tokens/img/eth.svg'; +import usdcLogo from 'libs/tokens/img/usdc.svg'; +import wethLogo from 'libs/tokens/img/weth.svg'; +import xvsLogo from 'libs/tokens/img/xvs.svg'; import type { Token } from 'types'; const ethToken: Token = { @@ -10,4 +14,31 @@ const ethToken: Token = { isNative: true, }; -export const tokens: Token[] = [ethToken]; +export const tokens: Token[] = [ + ethToken, + { + address: '0x4200000000000000000000000000000000000006', + decimals: 18, + symbol: 'WETH', + asset: wethLogo, + tokenWrapped: ethToken, + }, + { + address: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', + decimals: 8, + symbol: 'cbBTC', + asset: cbbtcLogo, + }, + { + address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', + decimals: 6, + symbol: 'USDC', + asset: usdcLogo, + }, + { + address: '0xebB7873213c8d1d9913D8eA39Aa12d74cB107995', + decimals: 18, + symbol: 'XVS', + asset: xvsLogo, + }, +]; diff --git a/packages/chains/src/chainMetadata.ts b/packages/chains/src/chainMetadata.ts index db71f9ec7c..6d405cdc6d 100644 --- a/packages/chains/src/chainMetadata.ts +++ b/packages/chains/src/chainMetadata.ts @@ -150,8 +150,7 @@ export const chainMetadata: { logoSrc: baseLogo, explorerUrl: 'https://basescan.org', layerZeroScanUrl: 'https://testnet.layerzeroscan.com', - // add BASE_MAINNET core comptroller address - corePoolComptrollerContractAddress: '', + corePoolComptrollerContractAddress: '0x0C7973F9598AA62f9e03B94E92C967fD5437426C', nativeToken: ethToken, }, [ChainId.BASE_SEPOLIA]: {