Skip to content

Commit

Permalink
Merge pull request #3625 from VenusProtocol/feat/add-base
Browse files Browse the repository at this point in the history
feat: add Base and Base Sepolia
  • Loading branch information
gleiser-oliveira authored Dec 19, 2024
2 parents fc84e56 + 792b92a commit b117d02
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 45 deletions.
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.7.0",
"@venusprotocol/isolated-pools": "3.7.0",
"@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",
"@venusprotocol/typescript-config": "*",
"@venusprotocol/venus-protocol": "9.3.0",
"@venusprotocol/venus-protocol": "9.4.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/coverage-v8": "^2.1.5",
"autoprefixer": "^10.4.16",
Expand Down
6 changes: 2 additions & 4 deletions apps/evm/src/config/subgraphUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const getIsolatedPoolsSubgraphUrls = ({
[ChainId.OPTIMISM_MAINNET]: `https://gateway.thegraph.com/api/${theGraphApiKey}/deployments/id/QmZqvM6BRz1nNvK41SbfcafW2sbLZpnDMmubpQ5phkmPD8`,
[ChainId.OPTIMISM_SEPOLIA]:
'https://api.studio.thegraph.com/query/64786/venus-il-optimism-sepolia/version/latest',
// TODO: add BASE_MAINNET once it's deployed
[ChainId.BASE_MAINNET]: '',
[ChainId.BASE_MAINNET]: `https://gateway.thegraph.com/api/${theGraphApiKey}/deployments/id/QmUurUxeGyFknvjVtYytvYyhftXKMyXrvamCtMgoTR6ZnQ`,
[ChainId.BASE_SEPOLIA]:
'https://api.studio.thegraph.com/query/64786/venus-isolated-pools-base-sepolia/latest',
};
Expand Down Expand Up @@ -63,8 +62,7 @@ export const getGovernanceSubgraphUrls = ({
[ChainId.OPTIMISM_MAINNET]: `https://gateway.thegraph.com/api/${theGraphApiKey}/deployments/id/QmdTVnzZrFhVn3Q158b3E2rNPFPmEEfyQwgN3im2GbCQLy`,
[ChainId.OPTIMISM_SEPOLIA]:
'https://api.studio.thegraph.com/query/64786/venus-governance-opsepolia/version/latest',
// TODO: add BASE_MAINNET once it's deployed
[ChainId.BASE_MAINNET]: '',
[ChainId.BASE_MAINNET]: `https://gateway.thegraph.com/api/${theGraphApiKey}/deployments/id/QmcDDMGa9oTzCLWMeSWg6mwULWDao5Mypw9raofBaSTNqw`,
[ChainId.BASE_SEPOLIA]:
'https://api.studio.thegraph.com/query/64786/venus-governance-base-sepolia/latest',
};
Expand Down
11 changes: 11 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,8 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.OPTIMISM_MAINNET,
ChainId.BASE_MAINNET,
ChainId.BASE_SEPOLIA,
],
isolatedPools: [
ChainId.BSC_MAINNET,
Expand All @@ -78,6 +82,7 @@ export const featureFlags = {
ChainId.ZKSYNC_MAINNET,
ChainId.OPTIMISM_MAINNET,
ChainId.OPTIMISM_SEPOLIA,
ChainId.BASE_SEPOLIA,
],
wrapUnwrapNativeToken: [
ChainId.BSC_MAINNET,
Expand All @@ -92,6 +97,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 +113,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 +129,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
46 changes: 44 additions & 2 deletions 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';
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';
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';
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';
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';
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';
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';
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';
import venusProtocolEthereumDeployments from '@venusprotocol/venus-protocol/deployments/ethereum_addresses.json';
Expand Down Expand Up @@ -153,6 +163,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: isolatedPoolsZkSyncMainnetDeployments.addresses.PoolLens,
[ChainId.OPTIMISM_SEPOLIA]: isolatedPoolsOptimismSepoliaDeployments.addresses.PoolLens,
[ChainId.OPTIMISM_MAINNET]: isolatedPoolsOptimismMainnetDeployments.addresses.PoolLens,
[ChainId.BASE_MAINNET]: isolatedPoolsBaseMainnetDeployments.addresses.PoolLens,
[ChainId.BASE_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolLens,
},
},
{
Expand All @@ -174,6 +186,8 @@ export const contracts: ContractConfig[] = [
isolatedPoolsOptimismSepoliaDeployments.addresses.PoolRegistry_Proxy,
[ChainId.OPTIMISM_MAINNET]:
isolatedPoolsOptimismMainnetDeployments.addresses.PoolRegistry_Proxy,
[ChainId.BASE_MAINNET]: isolatedPoolsBaseMainnetDeployments.addresses.PoolRegistry_Proxy,
[ChainId.BASE_SEPOLIA]: isolatedPoolsBaseSepoliaDeployments.addresses.PoolRegistry_Proxy,
},
},
{
Expand Down Expand Up @@ -214,6 +228,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: tokenBridgeZkSyncMainnetDeployments.addresses.XVS,
[ChainId.OPTIMISM_SEPOLIA]: tokenBridgeOptimismSepoliaDeployments.addresses.XVS,
[ChainId.OPTIMISM_MAINNET]: tokenBridgeOptimismMainnetDeployments.addresses.XVS,
[ChainId.BASE_MAINNET]: tokenBridgeBaseMainnetDeployments.addresses.XVS,
[ChainId.BASE_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVS,
},
},
{
Expand All @@ -232,6 +248,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.XVSVaultProxy,
[ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.XVSVaultProxy,
[ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.XVSVaultProxy,
[ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.XVSVaultProxy,
[ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSVaultProxy,
},
},
{
Expand All @@ -250,6 +268,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: venusProtocolZkSyncMainnetDeployments.addresses.XVSStore,
[ChainId.OPTIMISM_SEPOLIA]: venusProtocolOptimismSepoliaDeployments.addresses.XVSStore,
[ChainId.OPTIMISM_MAINNET]: venusProtocolOptimismMainnetDeployments.addresses.XVSStore,
[ChainId.BASE_MAINNET]: venusProtocolBaseMainnetDeployments.addresses.XVSStore,
[ChainId.BASE_SEPOLIA]: venusProtocolBaseSepoliaDeployments.addresses.XVSStore,
},
},
{
Expand Down Expand Up @@ -284,6 +304,10 @@ export const contracts: ContractConfig[] = [
venusGovernanceOptimismMainnetDeployments.addresses.OmnichainGovernanceExecutor,
[ChainId.OPTIMISM_SEPOLIA]:
venusGovernanceOptimismSepoliaDeployments.addresses.OmnichainGovernanceExecutor,
[ChainId.BASE_MAINNET]:
venusGovernanceBaseMainnetDeployments.addresses.OmnichainGovernanceExecutor,
[ChainId.BASE_SEPOLIA]:
venusGovernanceBaseSepoliaDeployments.addresses.OmnichainGovernanceExecutor,
},
},
{
Expand Down Expand Up @@ -326,6 +350,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 +370,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 +390,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 All @@ -378,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 @@ -402,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 @@ -418,6 +452,8 @@ export const contracts: ContractConfig[] = [
[ChainId.ZKSYNC_MAINNET]: tokenBridgeZkSyncMainnetDeployments.addresses.XVSProxyOFTDest,
[ChainId.OPTIMISM_SEPOLIA]: tokenBridgeOptimismSepoliaDeployments.addresses.XVSProxyOFTDest,
[ChainId.OPTIMISM_MAINNET]: tokenBridgeOptimismMainnetDeployments.addresses.XVSProxyOFTDest,
[ChainId.BASE_MAINNET]: tokenBridgeBaseMainnetDeployments.addresses.XVSProxyOFTDest,
[ChainId.BASE_SEPOLIA]: tokenBridgeBaseSepoliaDeployments.addresses.XVSProxyOFTDest,
},
},
{
Expand Down Expand Up @@ -602,8 +638,14 @@ export const contracts: ContractConfig[] = [
[isolatedPoolsOptimismSepoliaDeployments.addresses.Comptroller_Core.toLowerCase()]:
isolatedPoolsOptimismSepoliaDeployments.addresses.NativeTokenGateway_vWETH_Core,
},
[ChainId.BASE_MAINNET]: {},
[ChainId.BASE_SEPOLIA]: {},
[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,
},
},
},
];
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/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,
},
];
Loading

0 comments on commit b117d02

Please sign in to comment.