Skip to content

Commit

Permalink
feat: add Base mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
gleiser-oliveira committed Dec 18, 2024
1 parent 5d3bbaa commit e7a087d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/evm/src/hooks/useIsFeatureEnabled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.OPTIMISM_MAINNET,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
isolatedPools: [
Expand All @@ -83,7 +84,6 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
wrapUnwrapNativeToken: [
Expand Down
40 changes: 20 additions & 20 deletions apps/evm/src/libs/contracts/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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,
},
},
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -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,
},
},
Expand All @@ -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,
},
},
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
},
{
Expand All @@ -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,
},
},
{
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -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,
Expand Down
33 changes: 32 additions & 1 deletion apps/evm/src/libs/tokens/infos/commonTokens/baseMainnet.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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,
},
];
3 changes: 1 addition & 2 deletions packages/chains/src/chainMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]: {
Expand Down

0 comments on commit e7a087d

Please sign in to comment.