Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Base and Base Sepolia #3625

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shy-ducks-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@venusprotocol/evm": minor
---

add Base/Base Sepolia networks
10 changes: 5 additions & 5 deletions apps/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@
"@types/recharts": "^1.8.23",
"@types/redux-actions": "^2.6.2",
"@types/styled-components": "^5.1.26",
"@venusprotocol/governance-contracts": "^2.5.0",
"@venusprotocol/isolated-pools": "3.6.0",
"@venusprotocol/oracle": "2.6.0",
"@venusprotocol/governance-contracts": "2.5.0-dev.8",
"@venusprotocol/isolated-pools": "3.7.0-dev.7",
"@venusprotocol/oracle": "2.7.0",
"@venusprotocol/protocol-reserve": "2.4.0",
"@venusprotocol/stylelint-config": "*",
"@venusprotocol/token-bridge": "2.3.0",
"@venusprotocol/token-bridge": "2.4.0-dev.1",
"@venusprotocol/typescript-config": "*",
"@venusprotocol/venus-protocol": "9.3.0",
"@venusprotocol/venus-protocol": "9.4.0-dev.5",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/coverage-v8": "^2.1.5",
"autoprefixer": "^10.4.16",
Expand Down
13 changes: 13 additions & 0 deletions apps/evm/src/hooks/useIsFeatureEnabled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
marketParticipantCounts: [
ChainId.BSC_MAINNET,
Expand All @@ -56,6 +58,7 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.OPTIMISM_MAINNET,
ChainId.BASE_SEPOLIA,
],
isolatedPools: [
ChainId.BSC_MAINNET,
Expand All @@ -64,6 +67,8 @@ export const featureFlags = {
ChainId.SEPOLIA,
ChainId.ARBITRUM_ONE,
ChainId.ARBITRUM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
bridgeRoute: [
ChainId.BSC_MAINNET,
Expand All @@ -78,6 +83,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
wrapUnwrapNativeToken: [
ChainId.BSC_MAINNET,
Expand All @@ -92,6 +99,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
governanceSearch: [
ChainId.BSC_TESTNET,
Expand All @@ -106,6 +115,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
omnichainGovernance: [
ChainId.BSC_TESTNET,
Expand All @@ -120,6 +131,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
gaslessTransactions: [ChainId.ZKSYNC_SEPOLIA, ChainId.ZKSYNC_MAINNET],
web3DomainNames: [ChainId.BSC_MAINNET, ChainId.ETHEREUM, ChainId.ARBITRUM_ONE],
Expand Down
44 changes: 43 additions & 1 deletion apps/evm/src/libs/contracts/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ 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 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';
import venusGovernanceEthereumDeployments from '@venusprotocol/governance-contracts/deployments/ethereum_addresses.json';
Expand All @@ -21,6 +23,8 @@ 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 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';
import isolatedPoolsEthereumDeployments from '@venusprotocol/isolated-pools/deployments/ethereum_addresses.json';
Expand All @@ -34,6 +38,8 @@ import isolatedPoolsZkSyncSepoliaDeployments from '@venusprotocol/isolated-pools
import { abi as ResilientOracleAbi } from '@venusprotocol/oracle/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json';
import venusOracleArbitrumOneDeployments from '@venusprotocol/oracle/deployments/arbitrumone_addresses.json';
import venusOracleArbitrumSepoliaDeployments from '@venusprotocol/oracle/deployments/arbitrumsepolia_addresses.json';
import venusOracleBaseMainnetDeployments from '@venusprotocol/oracle/deployments/basemainnet_addresses.json';
import venusOracleBaseSepoliaDeployments from '@venusprotocol/oracle/deployments/basesepolia_addresses.json';
import venusOracleBscMainnetDeployments from '@venusprotocol/oracle/deployments/bscmainnet_addresses.json';
import venusOracleBscTestnetDeployments from '@venusprotocol/oracle/deployments/bsctestnet_addresses.json';
import venusOracleEthereumDeployments from '@venusprotocol/oracle/deployments/ethereum_addresses.json';
Expand All @@ -49,6 +55,8 @@ 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 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';
import tokenBridgeEthereumDeployments from '@venusprotocol/token-bridge/deployments/ethereum_addresses.json';
Expand Down Expand Up @@ -78,6 +86,8 @@ 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 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';
import venusProtocolEthereumDeployments from '@venusprotocol/venus-protocol/deployments/ethereum_addresses.json';
Expand Down Expand Up @@ -153,6 +163,9 @@ 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_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolLens,
},
},
{
Expand All @@ -174,6 +187,10 @@ 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_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolRegistry_Proxy,
},
},
{
Expand Down Expand Up @@ -214,6 +231,9 @@ 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_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVS,
},
},
{
Expand All @@ -232,6 +252,9 @@ 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_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSVaultProxy,
},
},
{
Expand All @@ -250,6 +273,9 @@ 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_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSStore,
},
},
{
Expand Down Expand Up @@ -284,6 +310,11 @@ export const contracts: ContractConfig[] = [
venusGovernanceOptimismMainnetDeployments.addresses.OmnichainGovernanceExecutor,
[ChainId.OPTIMISM_SEPOLIA]:
venusGovernanceOptimismSepoliaDeployments.addresses.OmnichainGovernanceExecutor,
// TODO: add BASE_MAINNET once deployed
// [ChainId.BASE_MAINNET]:
// ,
[ChainId.BASE_SEPOLIA]:
venusGovernanceBaseSepoliaDeployments.addresses.OmnichainGovernanceExecutor,
},
},
{
Expand Down Expand Up @@ -326,6 +357,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: '0xFEa0f491061cdb017041D6da43c98b6383097557',
[ChainId.OPTIMISM_MAINNET]: '0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E',
[ChainId.OPTIMISM_SEPOLIA]: '0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E',
[ChainId.BASE_MAINNET]: '0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E',
[ChainId.BASE_SEPOLIA]: '0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E',
},
},
{
Expand All @@ -344,6 +377,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: '0xF9cda624FBC7e059355ce98a31693d299FACd963',
[ChainId.OPTIMISM_MAINNET]: '0xca11bde05977b3631167028862be2a173976ca11',
[ChainId.OPTIMISM_SEPOLIA]: '0xca11bde05977b3631167028862be2a173976ca11',
[ChainId.BASE_MAINNET]: '0xca11bde05977b3631167028862be2a173976ca11',
[ChainId.BASE_SEPOLIA]: '0xca11bde05977b3631167028862be2a173976ca11',
},
},
{
Expand All @@ -362,6 +397,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: venusOracleZkSyncMainnetDeployments.addresses.ResilientOracle,
[ChainId.OPTIMISM_SEPOLIA]: venusOracleOptimismSepoliaDeployments.addresses.ResilientOracle,
[ChainId.OPTIMISM_MAINNET]: venusOracleOptimismMainnetDeployments.addresses.ResilientOracle,
[ChainId.BASE_MAINNET]: venusOracleBaseMainnetDeployments.addresses.ResilientOracle,
[ChainId.BASE_SEPOLIA]: venusOracleBaseSepoliaDeployments.addresses.ResilientOracle,
},
},
{
Expand Down Expand Up @@ -418,6 +455,8 @@ 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_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVSProxyOFTDest,
},
},
{
Expand Down Expand Up @@ -603,7 +642,10 @@ export const contracts: ContractConfig[] = [
isolatedPoolsOptimismSepoliaDeployments.addresses.NativeTokenGateway_vWETH_Core,
},
[ChainId.BASE_MAINNET]: {},
[ChainId.BASE_SEPOLIA]: {},
[ChainId.BASE_SEPOLIA]: {
[isolatedPoolsBaseSepoliaDeployments.addresses.Comptroller_Core.toLowerCase()]:
isolatedPoolsBaseSepoliaDeployments.addresses.NativeTokenGateway_vWETH_Core,
},
},
},
];
12 changes: 12 additions & 0 deletions apps/evm/src/libs/tokens/img/cbbtc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion apps/evm/src/libs/tokens/infos/commonTokens/baseSepolia.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: '0x0948001047A07e38F685f9a11ea1ddB16B234af9',
decimals: 8,
symbol: 'cbBTC',
asset: cbbtcLogo,
},
{
address: '0xFa264c13d657180e65245a9C3ac8d08b9F5Fc54D',
decimals: 6,
symbol: 'USDC',
asset: usdcLogo,
},
{
address: '0xE657EDb5579B82135a274E85187927C42E38C021',
decimals: 18,
symbol: 'XVS',
asset: xvsLogo,
},
];
2 changes: 2 additions & 0 deletions packages/chains/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum MainnetChainId {
ARBITRUM_ONE = ChainId.ARBITRUM_ONE,
ZKSYNC_MAINNET = ChainId.ZKSYNC_MAINNET,
OPTIMISM_MAINNET = ChainId.OPTIMISM_MAINNET,
BASE_MAINNET = ChainId.BASE_MAINNET,
}

export enum TestnetChainId {
Expand All @@ -31,6 +32,7 @@ export enum TestnetChainId {
ARBITRUM_SEPOLIA = ChainId.ARBITRUM_SEPOLIA,
ZKSYNC_SEPOLIA = ChainId.ZKSYNC_SEPOLIA,
OPTIMISM_SEPOLIA = ChainId.OPTIMISM_SEPOLIA,
BASE_SEPOLIA = ChainId.BASE_SEPOLIA,
}

export interface ChainMetadata {
Expand Down
Loading