diff --git a/index.html b/index.html index 82fccda1b..d562affba 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/logos/gnosis-chain-logo.svg b/public/images/logos/gnosis-chain-logo.svg new file mode 100644 index 000000000..39c2e3a38 --- /dev/null +++ b/public/images/logos/gnosis-chain-logo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/images/logos/meter-logo.svg b/public/images/logos/meter-logo.svg new file mode 100644 index 000000000..873bb1be5 --- /dev/null +++ b/public/images/logos/meter-logo.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/logos/telos-logo.svg b/public/images/logos/telos-logo.svg new file mode 100644 index 000000000..d741ec968 --- /dev/null +++ b/public/images/logos/telos-logo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/meter-favicon.png b/public/meter-favicon.png new file mode 100644 index 000000000..947912513 Binary files /dev/null and b/public/meter-favicon.png differ diff --git a/public/telos-favicon.png b/public/telos-favicon.png new file mode 100644 index 000000000..ada1d0f16 Binary files /dev/null and b/public/telos-favicon.png differ diff --git a/public/tokens/mtr.png b/public/tokens/mtr.png new file mode 100644 index 000000000..06c082820 Binary files /dev/null and b/public/tokens/mtr.png differ diff --git a/src/App.vue b/src/App.vue index 0e2afea44..dda6eb804 100644 --- a/src/App.vue +++ b/src/App.vue @@ -87,6 +87,7 @@ const themeMap = { celo: 'celo', sepolia: 'celo', 'gnosis-chain': 'gnosis-chain', + meter: 'meter', }; // Function to update theme based on the route slug const updateTheme = () => { diff --git a/src/assets/css/tailwind.css b/src/assets/css/tailwind.css index 35d9ce3e2..3af03016d 100644 --- a/src/assets/css/tailwind.css +++ b/src/assets/css/tailwind.css @@ -401,6 +401,107 @@ html[data-theme='gnosis-chain'] { --color-orange-900: 120, 53, 15; } +html[data-theme='meter'] { + /* Gray */ + + /* Gray scale with a navy touch */ + --color-gray-50: 242, 242, 245; /* Lightest, almost white with a hint of blue */ + --color-gray-100: 230, 230, 240; /* Very light gray with a subtle blue undertone */ + --color-gray-200: 215, 215, 230; /* Clear, light gray-blue */ + --color-gray-300: 190, 190, 210; /* Brighter, leading up to the deeper shades */ + --color-gray-400: 150, 150, 180; /* Transitioning more into the blue spectrum */ + --color-gray-500: 110, 110, 150; /* Slightly desaturated blue */ + --color-gray-600: 80, 80, 120; /* Deeper blue, maintaining a grayish vibe */ + --color-gray-700: 50, 50, 90; /* Darker blue-gray, getting closer to navy */ + --color-gray-800: 30, 30, 60; /* Deep navy, still a bit of lightness */ + --color-gray-850: 20, 25, 53; /* Very dark navy, almost matching --color-gray-900 */ + --color-gray-900: 10, 25, 47; /* New, very dark navy blue */ + + /* Primary */ + --color-primary-50: 83, 85, 94; + --color-primary-100: 73, 75, 84; + --color-primary-200: 63, 65, 74; + --color-primary-300: 53, 55, 64; + --color-primary-400: 43, 45, 54; + --color-primary-500: 33, 35, 44; + --color-primary-600: 23, 25, 34; + --color-primary-700: 13, 15, 24; + --color-primary-800: 3, 5, 14; + --color-primary-900: 0, 0, 4; + + /* Primary Dark */ + --color-primary-dark-50: 106, 124, 255; + --color-primary-dark-100: 96, 114, 255; + --color-primary-dark-200: 86, 104, 255; + --color-primary-dark-300: 76, 94, 255; + --color-primary-dark-400: 66, 84, 255; + --color-primary-dark-500: 56, 74, 255; + --color-primary-dark-600: 46, 64, 245; + --color-primary-dark-700: 36, 54, 235; + --color-primary-dark-800: 26, 44, 225; + --color-primary-dark-900: 16, 34, 215; + + /* Blue */ + --color-blue-50: 250, 255, 255; /* Lightest, almost white with a hint of blue */ + --color-blue-100: 235, 245, 255; /* Very light blue */ + --color-blue-200: 215, 235, 255; /* Clear, light blue */ + --color-blue-300: 185, 215, 255; /* Brighter, leading up to the vibrant 400 */ + --color-blue-400: 51, 153, 255; /* New, much brighter base color */ + --color-blue-500: 41, 143, 235; /* Slightly less bright for contrast */ + --color-blue-600: 31, 133, 215; /* Maintaining a vibrant gradient */ + --color-blue-700: 21, 123, 195; /* Darker yet still bright */ + --color-blue-800: 11, 113, 175; /* Deeper blue, retaining brightness */ + --color-blue-900: 1, 103, 155; /* Darkest in the series, still vivid */ + + /* Transition from Pink to Navy Blue */ + --color-pink-50: 253, 242, 255; /* Lightest, almost white with a hint of pink */ + --color-pink-100: 252, 231, 255; /* Very light pink */ + --color-pink-200: 251, 207, 255; /* Clear, light pink */ + --color-pink-300: 245, 178, 255; /* Transitioning towards blue */ + --color-pink-400: 238, 150, 255; /* Deeper pink, edging into purple */ + --color-pink-500: 231, 122, 220; /* Purple, as a bridge to darker blue */ + --color-pink-600: 0, 31, 63; /* Navy Blue, the new base color */ + --color-pink-700: 0, 28, 57; /* Slightly darker navy */ + --color-pink-800: 0, 25, 51; /* Even darker, maintaining the gradient */ + --color-pink-900: 0, 22, 45; /* Darkest in the series, deep navy */ + + /* Transition from Light Blue to Navy Blue */ + --color-purple-50: 240, 245, 255; /* Lightest blue, almost white */ + --color-purple-100: 230, 235, 255; /* Very light blue */ + --color-purple-200: 210, 220, 255; /* Clear, light blue */ + --color-purple-300: 180, 200, 255; /* Brighter, leading up to the vibrant mid-tones */ + --color-purple-400: 150, 170, 255; /* Transition shade towards deeper blue */ + --color-purple-500: 120, 140, 255; /* Adjusted to fit the new base color, still quite bright */ + --color-purple-600: 0, 31, 63; /* Navy Blue, the new base color */ + --color-purple-700: 0, 28, 57; /* Slightly darker navy */ + --color-purple-800: 0, 25, 51; /* Darker, maintaining the gradient */ + --color-purple-900: 0, 22, 45; /* Darkest in the series, deep navy */ + + /* Yellow */ + --color-yellow-50: 255, 255, 240; /* Lightest, almost white with a hint of yellow */ + --color-yellow-100: 255, 255, 230; /* Very light yellow */ + --color-yellow-200: 255, 255, 210; /* Clear, light yellow */ + --color-yellow-300: 255, 255, 190; /* Brighter, leading up to the vibrant 400 */ + --color-yellow-400: 255, 255, 170; /* New, much brighter base color */ + --color-yellow-500: 255, 250, 150; /* Adjusted to fit the new base color */ + --color-yellow-600: 255, 245, 130; /* Brighter, maintaining the gradient */ + --color-yellow-700: 255, 240, 110; /* Incrementally brighter */ + --color-yellow-800: 255, 235, 90; /* Keeping the brightness up */ + --color-yellow-900: 255, 230, 70; /* Brightest deep shade */ + + /* Orange */ + --color-orange-50: 255, 251, 235; + --color-orange-100: 254, 243, 199; + --color-orange-200: 253, 230, 138; + --color-orange-300: 252, 211, 77; + --color-orange-400: 251, 191, 36; + --color-orange-500: 245, 158, 11; + --color-orange-600: 217, 119, 6; + --color-orange-700: 180, 83, 9; + --color-orange-800: 146, 64, 14; + --color-orange-900: 120, 53, 15; +} + @layer utilities { .text-primary { @apply text-gray-900 dark:text-gray-100; diff --git a/src/assets/data/contracts/meter.json b/src/assets/data/contracts/meter.json new file mode 100644 index 000000000..c37a2b942 --- /dev/null +++ b/src/assets/data/contracts/meter.json @@ -0,0 +1,23 @@ +{ + "Authorizer": "0xA99e6dA471b63D1F23509A2141f9c3a76EF1f8ec", + "AuthorizerAdaptor": "0xD37f767df06fC690B0C24716D46Ca4db04b34c1b", + "AuthorizerAdaptorEntrypoint": "0xbdfBEB1afcB6411d91A8dCCfC0ce293a53a20542", + "AuthorizerWithAdaptorValidation": "0x5cbA76e20467742BCbbB38D2d14e16B66C2CAc0a", + "BalancerHelpers": "0xcA1e43769c7627889F465cC56C33D6673650364e", + "BalancerMinter": "0x18730De270BBD50C13430fAAF20BD96A491c0de1", + "BalancerQueries": "0x90FA60B7dbD665978d0a686147A894589BEB8281", + "BalancerRelayer": "0xB35B39Be5B520E40Ad67435168Cfd3DA86B1ED55", + "BatchRelayerLibrary": "0x61e6106CE69DdFDda28AaE767d889aF1E396d32a", + "BatchRelayerQueryLibrary": "0x65b457d134EE5Ba6a5De9202835E0523d2424E3E", + "ComposableStablePoolFactory": "0x7aa0DBFaCa97734F4E4Ae5DF0E3f2f957D76018F", + "GaugeController": "0xf6b4173Fd50c7DBdfa50f0D2EEd1207c02C31E02", + "MockComposableStablePool": "0x4f2E1EBaa28e1053234d837e032536Dc39EA15D5", + "MockWeightedPool": "0x2659c88DDB5B03224E10404258F3F2d2F1c85C60", + "MSYMMTokenAdmin": "0x694d28317F8D8c41D3D471687D92695A187D7f81", + "ProtocolFeePercentagesProvider": "0x4EEA4e1bA940BD93A98A674946905B36831d01D5", + "ProtocolFeesCollector": "0xb6bbC092FE2cEAbe696642382713e976d3db3AF1", + "SymmToken": "0x663345e09F4F4437F3D5df39BA5c2B5690532206", + "Vault": "0x913f21E596790aFC6AA45229E9ff8b7d0A473D5A", + "VotingEscrow": "0xF533A5C6B5d24831E138d66Fb88F28dc72fAFE9a", + "WeightedPoolFactory": "0xbd5A48ED2c877033EF379e342eC9c6fe16dC5710" +} diff --git a/src/assets/images/icons/networks/celo.svg b/src/assets/images/icons/networks/celo.svg new file mode 100644 index 000000000..7333a6d78 --- /dev/null +++ b/src/assets/images/icons/networks/celo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/src/assets/images/icons/networks/meter.svg b/src/assets/images/icons/networks/meter.svg new file mode 100644 index 000000000..a89464115 --- /dev/null +++ b/src/assets/images/icons/networks/meter.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/contextual/pages/pool/add-liquidity/Page.vue b/src/components/contextual/pages/pool/add-liquidity/Page.vue index d5bae30e8..d53a5ae28 100644 --- a/src/components/contextual/pages/pool/add-liquidity/Page.vue +++ b/src/components/contextual/pages/pool/add-liquidity/Page.vue @@ -20,6 +20,7 @@ const props = defineProps(); const pool = toRef(props, 'pool'); +console.log(pool); /** * PROVIDERS */ diff --git a/src/components/forms/pool_actions/AddLiquidityForm/AddLiquidityForm.vue b/src/components/forms/pool_actions/AddLiquidityForm/AddLiquidityForm.vue index fee0b52ce..92d2f154c 100644 --- a/src/components/forms/pool_actions/AddLiquidityForm/AddLiquidityForm.vue +++ b/src/components/forms/pool_actions/AddLiquidityForm/AddLiquidityForm.vue @@ -86,13 +86,17 @@ const excludedTokens = computed((): string[] => { }); const joinTokensWithBalance = computed(() => - poolJoinTokens.value.filter( - address => - includesAddress(tokensWithBalance.value, address) || - isSameAddress(address, wrappedNativeAsset.value.address) - ) + poolJoinTokens.value.filter(address => { + return address + ? includesAddress(tokensWithBalance.value, address) + : false || wrappedNativeAsset.value.address + ? isSameAddress(address, wrappedNativeAsset.value.address) + : false; + }) ); +console.log('joinTokensWithBalance', joinTokensWithBalance.value); + const joinTokensWithoutBalance = computed(() => poolJoinTokens.value.filter( address => !includesAddress(tokensWithBalance.value, address) diff --git a/src/components/images/AppIcon.vue b/src/components/images/AppIcon.vue index 6a988f060..77b31ee61 100644 --- a/src/components/images/AppIcon.vue +++ b/src/components/images/AppIcon.vue @@ -2,6 +2,7 @@ import { computed } from 'vue'; import useDarkMode from '@/composables/useDarkMode'; +import useNetwork from '@/composables/useNetwork'; /** * TYPES @@ -22,6 +23,12 @@ const props = withDefaults(defineProps(), { */ const { darkMode } = useDarkMode(); +const { networkSlug } = useNetwork(); + +const logo = computed(() => { + return `/images/logos/${networkSlug}-logo.svg`; +}); + // const slug = useNetwork().networkSlug; /** @@ -31,11 +38,6 @@ const useDarkLogo = computed(() => (props.forceDark ? true : darkMode.value)); diff --git a/src/components/navs/AppNav/AppSidebar/SidebarContent.vue b/src/components/navs/AppNav/AppSidebar/SidebarContent.vue index 9220aa456..5e83c7aec 100644 --- a/src/components/navs/AppNav/AppSidebar/SidebarContent.vue +++ b/src/components/navs/AppNav/AppSidebar/SidebarContent.vue @@ -38,14 +38,15 @@ const router = useRouter(); */ const blockIcon = ref(); +console.log('isVeBalSupported', isVeBalSupported); const navLinks = [ - { label: t('pool'), path: '/', goal: Goals.ClickNavPools }, + { label: t('pool'), path: `/${networkSlug}`, goal: Goals.ClickNavPools }, { label: t('swap'), path: `/${networkSlug}/swap`, goal: Goals.ClickNavSwap }, { label: t('claim'), path: `/${networkSlug}/claim`, goal: Goals.ClickNavClaim, - hide: !isVeBalSupported, + hide: !isVeBalSupported.value, }, { label: t('portfolio'), @@ -56,7 +57,7 @@ const navLinks = [ label: 'vTSYMM', path: `/${networkSlug}/vtsymm`, goal: Goals.ClickNavVebal, - hide: !isVeBalSupported, + hide: !isVeBalSupported.value, }, // { // label: 'Airdrop', diff --git a/src/composables/useNetwork.ts b/src/composables/useNetwork.ts index 571d7d318..d6c6cbd33 100644 --- a/src/composables/useNetwork.ts +++ b/src/composables/useNetwork.ts @@ -24,7 +24,7 @@ const NETWORK_ID = urlNetworkId || localStorageNetworkId || (Number(import.meta.env.VITE_NETWORK) as Network) || - Network.TELOS; + Network.CELO; if (windowAvailable) localStorage.setItem('networkId', NETWORK_ID.toString()); export const networkSlug = config[NETWORK_ID].slug; export const networkConfig = config[NETWORK_ID]; @@ -125,7 +125,7 @@ export function handleNetworkSlug( ) { const networkFromUrl = networkFromSlug(networkSlug); const localStorageNetwork = networkFor( - localStorage.getItem('networkId') ?? '40' + localStorage.getItem('networkId') ?? '42220' ); if (!networkFromUrl) { // missing or incorrect network name -> next() withtout network change diff --git a/src/composables/usePoolHelpers.ts b/src/composables/usePoolHelpers.ts index 2b88aaccb..8b152928a 100644 --- a/src/composables/usePoolHelpers.ts +++ b/src/composables/usePoolHelpers.ts @@ -32,7 +32,7 @@ import { cloneDeep, uniq, uniqWith } from 'lodash'; import { appUrl, getNetworkSlug, - isMainnet, + // isMainnet, isPoolBoostsEnabled, } from './useNetwork'; import useNumbers, { FNumFormats, numF } from './useNumbers'; @@ -792,8 +792,7 @@ export function usePoolHelpers(pool: Ref | Ref) { (): boolean => !!pool.value && isWrappedNativeAsset(pool.value) ); const isMainnetWstETHPool = computed( - (): boolean => - !!pool.value && includesWstEth(pool.value.tokensList) && isMainnet.value + (): boolean => !!pool.value && includesWstEth(pool.value.tokensList) // && isMainnet.value ); const poolJoinTokens = computed((): string[] => diff --git a/src/composables/useVeBAL.ts b/src/composables/useVeBAL.ts index 589ab856a..23b6654c0 100644 --- a/src/composables/useVeBAL.ts +++ b/src/composables/useVeBAL.ts @@ -18,8 +18,10 @@ const showRedirectModal = ref(false); /** * COMPUTED */ -export const isVeBalSupported = computed( - () => configService.network.addresses.veBAL !== '' +export const isVeBalSupported = computed(() => + configService.network.addresses.veBAL + ? configService.network.addresses.veBAL !== '' + : false ); export const isGaugesSupported = computed( diff --git a/src/lib/config/celo/index.ts b/src/lib/config/celo/index.ts index c97214d25..840e6dac9 100644 --- a/src/lib/config/celo/index.ts +++ b/src/lib/config/celo/index.ts @@ -35,12 +35,12 @@ const config: Config = { blocks: '', }, bridgeUrl: '', - supportsEIP1559: false, + supportsEIP1559: true, supportsElementPools: false, blockTime: 2, nativeAsset: { name: 'Celo', - address: '0x471EcE3750Da237f93B8E339c536989b8978a438', + address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', symbol: 'CELO', decimals: 18, deeplinkId: 'celo', diff --git a/src/lib/config/celo/tokens.ts b/src/lib/config/celo/tokens.ts index be5483144..cbc864409 100644 --- a/src/lib/config/celo/tokens.ts +++ b/src/lib/config/celo/tokens.ts @@ -6,13 +6,13 @@ const tokens: TokenConstants = { }, InitialSwapTokens: { input: '0x471EcE3750Da237f93B8E339c536989b8978a438', - output: '0xb19382073c7A0aDdbb56Ac6AF1808Fa49e377B75', + output: '0x765DE816845861e75A25fCA122bb6898B8B1282a', }, Addresses: { - nativeAsset: '0x471EcE3750Da237f93B8E339c536989b8978a438', - wNativeAsset: '0x471EcE3750Da237f93B8E339c536989b8978a438', - WETH: '0x471EcE3750Da237f93B8E339c536989b8978a438', - BAL: '0x8427bD503dd3169cCC9aFF7326c15258Bc305478', + nativeAsset: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + wNativeAsset: '', + WETH: '', + BAL: '0x8427bd503dd3169ccc9aff7326c15258bc305478', bbaUSD: '', bbaUSDv2: '', rETH: '', diff --git a/src/lib/config/gnosis-chain/contracts.ts b/src/lib/config/gnosis-chain/contracts.ts index fe1db8f09..8f003a7a8 100644 --- a/src/lib/config/gnosis-chain/contracts.ts +++ b/src/lib/config/gnosis-chain/contracts.ts @@ -1,30 +1,27 @@ import { Contracts } from '../types'; -import * as gnosis from '@/assets/data/contracts/gnosis.json'; const contracts: Contracts = { merkleRedeem: '', - merkleOrchard: '0x35b50C7955e7D0E8298e043C9F4dCDef737b9f5a', - multicall: '0xbb6fab6b627947dae0a75808250d8b2652952cb5', - authorizer: gnosis.Authorizer, - vault: gnosis.Vault, - weightedPoolFactory: gnosis.WeightedPoolFactory, - stablePoolFactory: gnosis.StablePoolFactory, + merkleOrchard: '', + multicall: '0xFAa296891cA6CECAF2D86eF5F7590316d0A17dA0', + authorizer: '0xAb758532D05d2A2fc7b2853ebe54Ac17fE17Ea7f', + vault: '0x24F87b37F4F249Da61D89c3FF776a55c321B2773', + weightedPoolFactory: '0xb13A501fA658389e437E3047d56F2Bf945207a5A', + stablePoolFactory: '0xF9e6BE5A015Da5dc29B42ff345bB7Dd1b6C60aC7', lidoRelayer: '', - balancerHelpers: gnosis.BalancerHelpers, - batchRelayer: gnosis.BalancerRelayer, - gaugeFactory: gnosis.ChildChainLiquidityGaugeFactory, - balancerMinter: gnosis.L2BalancerPseudoMinter, + balancerHelpers: '0xe007Ba1c5665567175B4d462f8dba14506e7f592', + batchRelayer: '0xDCE2ea355530c098f5B9410b6B2663E0FFf246Bf', + gaugeFactory: '', + balancerMinter: '', gaugeController: '', tokenAdmin: '', veBAL: '', - veDelegationProxy: '0x7A2535f5fB47b8e44c02Ef5D9990588313fe8F05', + veDelegationProxy: '', veBALHelpers: '', feeDistributor: '', feeDistributorDeprecated: '', faucet: '', - gaugeRewardsHelper: gnosis.ChildChainGaugeRewardHelper, - gaugeWorkingBalanceHelper: gnosis.ChildChainGaugeWorkingBalanceHelper, - gaugeCheckpointer: gnosis.ChildChainGaugeCheckpointer, + gaugeRewardsHelper: '', }; export default contracts; diff --git a/src/lib/config/gnosis-chain/index.ts b/src/lib/config/gnosis-chain/index.ts index f3bda7ca0..a8ecb189b 100644 --- a/src/lib/config/gnosis-chain/index.ts +++ b/src/lib/config/gnosis-chain/index.ts @@ -9,7 +9,7 @@ const config: Config = { key: '100', chainId: 100, layerZeroChainId: 145, - supportsVeBalSync: true, + supportsVeBalSync: false, chainName: 'Gnosis Chain', name: 'Gnosis Chain', shortName: 'Gnosis', @@ -25,17 +25,16 @@ const config: Config = { publicRpc: 'https://rpc.gnosis.gateway.fm', explorer: 'https://gnosisscan.io', explorerName: 'Gnosisscan', - balancerApi: 'https://api.balancer.fi', + balancerApi: '', subgraph: - 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gnosis-chain-v2', + 'https://api.thegraph.com/subgraphs/name/centfinance/symmetric-v2-gnosis', poolsUrlV2: '', subgraphs: { main: [ - 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gnosis-chain-v2', + 'https://api.thegraph.com/subgraphs/name/centfinance/symmetric-v2-gnosis', ], aave: '', - gauge: - 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges-gnosis-chain', + gauge: '', blocks: '', }, bridgeUrl: 'https://bridge.gnosischain.com/', diff --git a/src/lib/config/gnosis-chain/pools.ts b/src/lib/config/gnosis-chain/pools.ts index 47e6cd58d..4663c9ab3 100644 --- a/src/lib/config/gnosis-chain/pools.ts +++ b/src/lib/config/gnosis-chain/pools.ts @@ -1,10 +1,15 @@ -import { Protocol } from '@/composables/useProtocols'; -import { CSP_ISSUE_POOL_IDS } from '@/constants/pool-lists/csp-issue'; -import { PoolFeature, PoolWarning, Pools } from '@/types/pools'; -import { Network } from '../types'; +import { Pools } from '@/types/pools'; const pools: Pools = { - IdsMap: {}, + IdsMap: { + staBAL: '', + bbAaveUSD: { + v1: '', + v2: '', + v3: '', + }, + veBAL: '', + }, Pagination: { PerPage: 10, PerPool: 10, @@ -27,16 +32,7 @@ const pools: Pools = { 'ComposableStable', ], Stable: { - AllowList: [ - '0xfedb19ec000d38d92af4b21436870f115db22725000000000000000000000010', // bb-ag-usd - '0x9949f1884b61a8265e12056650c1ac4677a75403000000000000000000000014', // 2EUR (EURe) - '0xa611a551b95b205ccd9490657acf7899daee5db700000000000000000000002e', // EURe / bb-ag-usd - '0x5c78d05b8ecf97507d1cf70646082c54faa4da95000000000000000000000030', // agEUR / EURe - '0xbad20c15a773bf03ab973302f61fabcea5101f0a000000000000000000000034', // WETH / wstETH - '0xe15cac1df3621e001f76210ab12a7f1a1691481f000000000000000000000044', // bb-ag-USD - '0x2086f52651837600180de173b09470f54ef7491000000000000000000000004f', // xdai-usdc-usdt - '0x0c1b9ce6bf6c01f587c2ee98b0ef4b20c6648753000000000000000000000050', // eure-stabal3 - ], + AllowList: [], }, Investment: { AllowList: [], @@ -44,133 +40,22 @@ const pools: Pools = { Weighted: { // Only effective after given timestamp here: usePool.ts#createdAfterTimestamp // see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic. - AllowList: [ - '0xa99fd9950b5d5dceeaf4939e221dca8ca9b938ab000100000000000000000025', // 25WETH-25BAL-25GNO-25wxDAI - '0x388cae2f7d3704c937313d990298ba67d70a3709000200000000000000000026', // 50AGVE-50GNO - '0x4bcf6b48906fa0f68bea1fc255869a41241d4851000200000000000000000021', // 50WXDAI-50MPS - '0x5519e2d8a0af0944ea639c6dbad69a174de3ecf800010000000000000000003b', // 25BAL-25GNO-25bb-WETH-wstETH-25wxDAI - '0xbc130c4989e10941142b34f054eb38d69fdce9df000200000000000000000049', // 20XOC-80USDC - '0xba1a5b19d09a79dada039b1f974015c5a989d5fd000100000000000000000046', // agUSD-agWETH-agWBTC - '0x4de21b365d6543661d0e105e579a34b963862497000200000000000000000045', // 50bbagGNO-50bbagUSD - '0x0c1b9ce6bf6c01f587c2ee98b0ef4b20c6648753000000000000000000000050', - '0x00df7f58e1cf932ebe5f54de5970fb2bdf0ef06d00010000000000000000005b', // B-50wstETH-25BAL-25AURA - '0x4cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c', // B-50wstETH-50COW - '0xeb30c85cc528537f5350cf5684ce6a4538e13394000200000000000000000059', // B-50USD-50wstETH - '0x4683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a', // B-50wstETH-50GNO - '0xb8bb1ce9c6e5401d66fe2126db6e7387e1e24ffe00020000000000000000003d', // WETH/GNO - '0x274dedb9356c3e1e24bfe2bf3d4349fbdbfa0d14000200000000000000000054', // staBAL/GNO - '0x66888e4f35063ad8bb11506a6fde5024fb4f1db0000100000000000000000053', // WETH/staBAL/WBTC - '0x7caef9e452ce161dec936ace7eab571d1023b20900020000000000000000005d', // B-50wstETH-50NEXT - '0x77e5bf699db38c578b2982c3e262e9c5f1f50fd0000200000000000000000061', // B-50USD-50bIBTA - '0xe85eb550e98ee66d19c667de24c5c8e10fee6504000200000000000000000060', // B-50USD-50bCSPX - '0xf6bfffb47bc125564cbb6cc0e7633eb7addaefce00020000000000000000005e', // B-50USD-50bIB01 - ], - }, - Factories: { - '0xc128468b7ce63ea702c1f104d55a2566b13d3abd': 'composableStablePool', // ComposableStable V3 - '0xc128a9954e6c874ea3d62ce62b468ba073093f25': 'weightedPool', // WeightedPool V3 - '0x6cad2ea22bfa7f4c14aae92e47f510cd5c509bc7': 'weightedPool', // weighted pool v4 - '0xd87f44df0159dc78029ab9ca7d7e57e7249f5acd': 'composableStablePool', // ComposableStable V4 - '0x4bdcc2fb18aeb9e2d281b0278d946445070eada7': 'composableStablePool', // ComposableStable V5 + AllowList: [], }, + Factories: {}, Stakable: { - VotingGaugePools: [ - '0x66f33ae36dd80327744207a48122f874634b3ada000100000000000000000013', - '0xf48f01dcb2cbb3ee1f6aab0e742c2d3941039d56000200000000000000000012', - '0xb973ca96a3f0d61045f53255e319aedb6ed49240000200000000000000000011', - '0xfedb19ec000d38d92af4b21436870f115db22725000000000000000000000010', - '0xbad20c15a773bf03ab973302f61fabcea5101f0a000000000000000000000034', - '0x5c78d05b8ecf97507d1cf70646082c54faa4da95000000000000000000000030', - '0x21d4c792ea7e38e0d0819c2011a2b1cb7252bd9900020000000000000000001e', - '0xba1a5b19d09a79dada039b1f974015c5a989d5fd000100000000000000000046', - '0x4de21b365d6543661d0e105e579a34b963862497000200000000000000000045', - '0xe15cac1df3621e001f76210ab12a7f1a1691481f000000000000000000000044', - '0xb8bb1ce9c6e5401d66fe2126db6e7387e1e24ffe00020000000000000000003d', - '0x66888e4f35063ad8bb11506a6fde5024fb4f1db0000100000000000000000053', - '0x2086f52651837600180de173b09470f54ef7491000000000000000000000004f', - '0x274dedb9356c3e1e24bfe2bf3d4349fbdbfa0d14000200000000000000000054', - '0x0c1b9ce6bf6c01f587c2ee98b0ef4b20c6648753000000000000000000000050', - '0xeb30c85cc528537f5350cf5684ce6a4538e13394000200000000000000000059', - '0x4683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a', - '0x4cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c', - '0x00df7f58e1cf932ebe5f54de5970fb2bdf0ef06d00010000000000000000005b', - ], + VotingGaugePools: [], AllowList: [], }, - Metadata: { - '0xfedb19ec000d38d92af4b21436870f115db22725000000000000000000000010': { - name: 'Balancer Boosted Agave USD', - hasIcon: false, - features: { - [PoolFeature.Boosted]: { - featureProtocols: [Protocol.Agave], - }, - }, - }, - '0x4de21b365d6543661d0e105e579a34b963862497000200000000000000000045': { - name: 'Balancer Boosted Agave GNO/USD', - hasIcon: false, - features: { - [PoolFeature.Boosted]: { - featureProtocols: [Protocol.Agave], - }, - }, - }, - '0xf48f01dcb2cbb3ee1f6aab0e742c2d3941039d56000200000000000000000012': { - name: 'Balancer Boosted Agave GNO/WETH', - hasIcon: false, - features: { - [PoolFeature.Boosted]: { - featureProtocols: [Protocol.Agave], - }, - }, - }, - '0xba1a5b19d09a79dada039b1f974015c5a989d5fd000100000000000000000046': { - name: 'Balancer Boosted Agave WETH/WBTC/USD', - hasIcon: false, - features: { - [PoolFeature.Boosted]: { - featureProtocols: [Protocol.Agave], - }, - }, - }, - }, - Deep: [ - '0xfedb19ec000d38d92af4b21436870f115db22725000000000000000000000010', // agave stable - '0x66f33ae36dd80327744207a48122f874634b3ada000100000000000000000013', // agave tricrypto - '0xb973ca96a3f0d61045f53255e319aedb6ed49240000200000000000000000011', // agave gno/usdc - '0xf48f01dcb2cbb3ee1f6aab0e742c2d3941039d56000200000000000000000012', // agave gno/weth - '0xe15cac1df3621e001f76210ab12a7f1a1691481f000000000000000000000044', // bb-ag-USD - '0xba1a5b19d09a79dada039b1f974015c5a989d5fd000100000000000000000046', // agUSD-agWETH-agWBTC - '0x4de21b365d6543661d0e105e579a34b963862497000200000000000000000045', // 50bbagGNO-50bbagUSD - ], - Deprecated: { - '0xf48f01dcb2cbb3ee1f6aab0e742c2d3941039d56000200000000000000000012': { - newPool: - '0xb8bb1ce9c6e5401d66fe2126db6e7387e1e24ffe00020000000000000000003d', - description: 'deprecatedPool.hasNewPool.description', - }, - '0xba1a5b19d09a79dada039b1f974015c5a989d5fd000100000000000000000046': { - newPool: - '0x66888e4f35063ad8bb11506a6fde5024fb4f1db0000100000000000000000053', - description: 'deprecatedPool.hasNewPool.description', - }, - '0xe15cac1df3621e001f76210ab12a7f1a1691481f000000000000000000000044': { - newPool: - '0x2086f52651837600180de173b09470f54ef7491000000000000000000000004f', - description: 'deprecatedPool.hasNewPool.description', - }, - '0x4de21b365d6543661d0e105e579a34b963862497000200000000000000000045': { - newPool: - '0x274dedb9356c3e1e24bfe2bf3d4349fbdbfa0d14000200000000000000000054', - description: 'deprecatedPool.hasNewPool.description', - }, - }, + Metadata: {}, + Deep: [], BoostedApr: [], - DisabledJoins: [...CSP_ISSUE_POOL_IDS[Network.GNOSIS]], - Issues: { - [PoolWarning.CspPoolVulnWarning]: CSP_ISSUE_POOL_IDS[Network.GNOSIS], + DisabledJoins: [], + Deprecated: { + deprecatedid: {}, //Used for unit testing }, + ExitViaInternalBalance: [], + Risks: {}, }; export default pools; diff --git a/src/lib/config/gnosis-chain/tokenlists.ts b/src/lib/config/gnosis-chain/tokenlists.ts index bab8a53dc..00138df0f 100644 --- a/src/lib/config/gnosis-chain/tokenlists.ts +++ b/src/lib/config/gnosis-chain/tokenlists.ts @@ -3,7 +3,7 @@ import { TokenListURLMap } from '@/types/TokenList'; const tokenlists: TokenListURLMap = { Balancer: { Allowlisted: - 'https://raw.githubusercontent.com/balancer/tokenlists/main/generated/balancer.tokenlist.json', + 'https://raw.githubusercontent.com/centfinance/Symmetric.WebInterface-v2/develop/src/lib/config/listed.tokenlist.json', }, External: [ 'https://unpkg.com/@1hive/default-token-list@latest/build/honeyswap-default.tokenlist.json', diff --git a/src/lib/config/gnosis-chain/tokens.ts b/src/lib/config/gnosis-chain/tokens.ts index 00601e328..ad159dccb 100644 --- a/src/lib/config/gnosis-chain/tokens.ts +++ b/src/lib/config/gnosis-chain/tokens.ts @@ -2,17 +2,17 @@ import { TokenConstants } from '../types'; const tokens: TokenConstants = { Popular: { - Symbols: ['WXDAI', 'WETH', 'BAL'], + Symbols: ['WXDAI', 'WETH', 'SYMM'], }, InitialSwapTokens: { input: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', - output: '0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', + output: '0xc45b3c1c24d5f54e7a2cf288ac668c74dd507a84', }, Addresses: { nativeAsset: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', wNativeAsset: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', WETH: '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1', - BAL: '0x7eF541E2a22058048904fE5744f9c7E4C57AF717', + BAL: '0xc45b3c1c24d5f54e7a2cf288ac668c74dd507a84', }, }; diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts index 3814c2b0c..3d5cd4fd8 100644 --- a/src/lib/config/index.ts +++ b/src/lib/config/index.ts @@ -4,30 +4,22 @@ import { Config, Network } from './types'; // import avalanche from './avalanche'; // import base from './base'; // import goerli from './goerli'; -// import gnosisChain from './gnosis-chain'; +import gnosisChain from './gnosis-chain'; // import mainnet from './mainnet'; // import optimism from './optimism'; // import polygon from './polygon'; // import sepolia from './sepolia'; // import zkevm from './zkevm'; import telos from './telos'; -import telosTestnet from './telos-testnet'; -// import celo from './celo'; +// import telosTestnet from './telos-testnet'; +import celo from './celo'; +import meter from './meter'; const config: Record = { [Network.TELOS]: telos, - [Network.TELOSTESTNET]: telosTestnet, - // [Network.CELO]: celo, - // [Network.MAINNET]: mainnet, - // [Network.GOERLI]: goerli, - // [Network.POLYGON]: polygon, - // [Network.ARBITRUM]: arbitrum, - // [Network.OPTIMISM]: optimism, - // [Network.GNOSIS]: gnosisChain, - // [Network.ZKEVM]: zkevm, - // [Network.AVALANCHE]: avalanche, - // [Network.SEPOLIA]: sepolia, - // [Network.BASE]: base, + [Network.CELO]: celo, + [Network.GNOSIS]: gnosisChain, + [Network.METER]: meter, }; export default config; diff --git a/src/lib/config/meter/contracts.ts b/src/lib/config/meter/contracts.ts new file mode 100644 index 000000000..a8d425006 --- /dev/null +++ b/src/lib/config/meter/contracts.ts @@ -0,0 +1,30 @@ +import { Contracts } from '../types'; +import * as meter from '@/assets/data/contracts/meter.json'; + +const contracts: Contracts = { + merkleRedeem: '', + merkleOrchard: '', + merkleOrchardV2: '', + multicall: '0xca11bde05977b3631167028862be2a173976ca11', + authorizer: meter.Authorizer, + vault: meter.Vault, + weightedPoolFactory: meter.WeightedPoolFactory, + stablePoolFactory: meter.ComposableStablePoolFactory, + lidoRelayer: '', + balancerHelpers: meter.BalancerHelpers, + balancerQueries: meter.PoolDataQueries, + batchRelayer: meter.BalancerRelayer, + veBAL: '', + gaugeController: '', + gaugeFactory: '', + balancerMinter: '', + tokenAdmin: '', + veDelegationProxy: '', + veBALHelpers: '', + feeDistributor: '', + feeDistributorDeprecated: '', + faucet: '', + omniVotingEscrow: '', +}; + +export default contracts; diff --git a/src/lib/config/meter/index.ts b/src/lib/config/meter/index.ts new file mode 100644 index 000000000..94757d470 --- /dev/null +++ b/src/lib/config/meter/index.ts @@ -0,0 +1,72 @@ +import { Config } from '../types'; +import contracts from './contracts'; +import keys from './keys'; +import pools from './pools'; +import tokenlists from './tokenlists'; +import tokens from './tokens'; +import rateProviders from './rateProviders'; + +const config: Config = { + key: '82', + chainId: 82, + chainName: 'Meter', + name: 'Meter', + shortName: 'meter', + monorepoName: 'meter', + slug: 'meter', + network: 'meter', + trustWalletNetwork: 'meter', + unknown: false, + visibleInUI: true, + testNetwork: false, + rpc: 'https://meter.blockpi.network/v1/rpc/216bb10a3653b0a8131afee4f6cf1982945022b4', + ws: ``, + explorer: 'https://explorer.meter.io/', + explorerName: 'Meter Explorer', + subgraph: + 'https://graph-meter.voltswap.finance/subgraphs/name/symmetric-meter', + balancerApi: '', + poolsUrlV2: + 'https://storageapi.fleek.co/johngrantuk-team-bucket/poolsV2.json', + subgraphs: { + main: [ + 'https://graph-meter.voltswap.finance/subgraphs/name/symmetric-meter', + ], + aave: '', + gauge: '', + blocks: '', + }, + bridgeUrl: 'https://passport.meter.io/', + supportsEIP1559: false, + supportsElementPools: false, + blockTime: 1.5, + nativeAsset: { + name: 'MTR', + address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + symbol: 'MTR', + decimals: 18, + deeplinkId: 'meter', + logoURI: 'tokens/mtr.png', + minTransactionBuffer: '0.1', + }, + thirdParty: { + coingecko: { + nativeAssetId: 'meter', + platformId: 'ethereum', + }, + }, + addresses: { + ...contracts, + }, + pools, + tokens, + keys, + gauges: { + type: 2, + weight: 100, + }, + tokenlists, + rateProviders, +}; + +export default config; diff --git a/src/lib/config/meter/keys.ts b/src/lib/config/meter/keys.ts new file mode 100644 index 000000000..b9731e6b3 --- /dev/null +++ b/src/lib/config/meter/keys.ts @@ -0,0 +1,5 @@ +import { Keys } from '../types'; + +const keys: Keys = {}; + +export default keys; diff --git a/src/lib/config/meter/pools.ts b/src/lib/config/meter/pools.ts new file mode 100644 index 000000000..077cf9736 --- /dev/null +++ b/src/lib/config/meter/pools.ts @@ -0,0 +1,63 @@ +import { Pools } from '@/types/pools'; + +const pools: Pools = { + IdsMap: { + veBAL: '0x0000000000000000000000000000000000000000', + }, + Pagination: { + PerPage: 15, + PerPool: 15, + PerPoolInitial: 5, + }, + BoostsEnabled: true, + DelegateOwner: '0x51db3Cc6431fe6297270360dE47345B0149E1F51', + ZeroAddress: '0x0000000000000000000000000000000000000000', + DynamicFees: { + Gauntlet: [], + }, + BlockList: [''], + IncludedPoolTypes: [ + 'Weighted', + 'Stable', + 'MetaStable', + 'LiquidityBootstrapping', + 'Investment', + 'StablePhantom', + 'ComposableStable', + 'Managed', + ], + Stable: { + AllowList: [ + '0x1ff97abe4c5a4b7ff90949b637e71626bef0dcee000000000000000000000002', //USDT-USDC-suUSD + ], + }, + Investment: { + AllowList: [], + }, + Weighted: { + // Only effective after given timestamp here: usePool.ts#createdAfterTimestamp + // see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic. + AllowList: [ + '0xd9fe77653c2b75cf3442c365a3f1f9c7ed1612c7000200000000000000000003', //MTRG/USDT-USDC-suUSD + ], + }, + Factories: { + '0xbd5a48ed2c877033ef379e342ec9c6fe16dc5710': 'weightedPool', // Weighted V5 + '0x7aa0dbfaca97734f4e4ae5df0e3f2f957d76018f': 'composableStablePool', // ComposableStable V5 + }, + Stakable: { + VotingGaugePools: [], + AllowList: [], + }, + Metadata: {}, + Deep: [ + '0xd9fe77653c2b75cf3442c365a3f1f9c7ed1612c7000200000000000000000003', //MTRG/USDT-USDC-suUSD + ], + Deprecated: {}, + GaugeMigration: {}, + BoostedApr: [], + DisabledJoins: [], + Issues: {}, +}; + +export default pools; diff --git a/src/lib/config/meter/rateProviders.ts b/src/lib/config/meter/rateProviders.ts new file mode 100644 index 000000000..a2072658f --- /dev/null +++ b/src/lib/config/meter/rateProviders.ts @@ -0,0 +1,9 @@ +import { RateProviders } from '../types'; + +const rateProviders: RateProviders = { + '*': { + '0x0000000000000000000000000000000000000000': true, + }, +}; + +export default rateProviders; diff --git a/src/lib/config/meter/tokenlists.ts b/src/lib/config/meter/tokenlists.ts new file mode 100644 index 000000000..27fd711e9 --- /dev/null +++ b/src/lib/config/meter/tokenlists.ts @@ -0,0 +1,14 @@ +import { TokenListURLMap } from '@/types/TokenList'; + +const tokenlists: TokenListURLMap = { + Balancer: { + Allowlisted: + 'https://raw.githubusercontent.com/centfinance/tokenlists/main/generated/symmetric.tokenlist.json', + }, + External: [ + // 'https://raw.githubusercontent.com/telosnetwork/token-list/main/telosevm.tokenlist.json', + // 'https://raw.githubusercontent.com/swapsicledex/swapsicle-default-token-list/master/swapsicle.tokenlist.json', + ], +}; + +export default tokenlists; diff --git a/src/lib/config/meter/tokens.ts b/src/lib/config/meter/tokens.ts new file mode 100644 index 000000000..6a3e7893a --- /dev/null +++ b/src/lib/config/meter/tokens.ts @@ -0,0 +1,34 @@ +import { TokenConstants } from '../types'; + +const tokens: TokenConstants = { + Popular: { + Symbols: ['WMTR', 'MTRG', 'USDC.eth', 'USDT.eth', 'mSYMM'], + }, + InitialSwapTokens: { + input: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + output: '0x8d97cea50351fb4329d591682b148d43a0c3611b', + }, + Addresses: { + nativeAsset: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', + wNativeAsset: '0x160361ce13ec33c993b5cca8f62b6864943eb083', + WETH: '0x160361ce13ec33c993b5cca8f62b6864943eb083', + BAL: '0x6ab5792b887Eb3F63A8915240F926e829982d3F5', + rETH: '', + stETH: '0x215d603293357ca222be92a1bf75eec38def0aad', + wstETH: '0xe2de616fbd8cb9180b26fcfb1b761a232fe56717', + }, + PriceChainMap: { + /** + * Addresses must be lower case and map from goerli to mainnet, e.g + * [goerli address]: mainnet address + */ + // USDT + '0x5fa41671c48e3c951afc30816947126ccc8c162e': + '0xdac17f958d2ee523a2206206994597c13d831ec7', + // USDC + '0xd86e243fc0007e6226b07c9a50c9d70d78299eb5': + '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + }, +}; + +export default tokens; diff --git a/src/lib/config/types.ts b/src/lib/config/types.ts index 3f41f19ea..5d6125e06 100644 --- a/src/lib/config/types.ts +++ b/src/lib/config/types.ts @@ -85,6 +85,7 @@ export enum Network { AVALANCHE = 43114, SEPOLIA = 11155111, TELOS = 40, + METER = 82, TELOSTESTNET = 41, CELO = 42220, } diff --git a/src/lib/scripts/addresses-meter.json b/src/lib/scripts/addresses-meter.json new file mode 100644 index 000000000..1ced5e440 --- /dev/null +++ b/src/lib/scripts/addresses-meter.json @@ -0,0 +1,151 @@ +{ + "20210418-authorizer": { + "contracts": [ + { + "name": "Authorizer", + "address": "0xA99e6dA471b63D1F23509A2141f9c3a76EF1f8ec" + } + ], + "status": "ACTIVE" + }, + "20210418-vault": { + "contracts": [ + { + "name": "Vault", + "address": "0x913f21E596790aFC6AA45229E9ff8b7d0A473D5A" + }, + { + "name": "ProtocolFeesCollector", + "address": "0xb6bbC092FE2cEAbe696642382713e976d3db3AF1" + }, + { + "name": "BalancerHelpers", + "address": "0xcA1e43769c7627889F465cC56C33D6673650364e" + } + ], + "status": "ACTIVE" + }, + "20220325-authorizer-adaptor": { + "contracts": [ + { + "name": "AuthorizerAdaptor", + "address": "0xD37f767df06fC690B0C24716D46Ca4db04b34c1b" + } + ], + "status": "ACTIVE" + }, + "20220325-balancer-token-admin": { + "contracts": [ + { + "name": "MSYMMTokenAdmin", + "address": "0x694d28317F8D8c41D3D471687D92695A187D7f81" + } + ], + "status": "ACTIVE" + }, + "20220325-gauge-controller": { + "contracts": [ + { + "name": "VotingEscrow", + "address": "0xF533A5C6B5d24831E138d66Fb88F28dc72fAFE9a" + }, + { + "name": "GaugeController", + "address": "0xf6b4173Fd50c7DBdfa50f0D2EEd1207c02C31E02" + }, + { + "name": "BalancerMinter", + "address": "0x18730De270BBD50C13430fAAF20BD96A491c0de1" + } + ], + "status": "ACTIVE" + }, + "20220721-balancer-queries": { + "contracts": [ + { + "name": "BalancerQueries", + "address": "0x90FA60B7dbD665978d0a686147A894589BEB8281" + } + ], + "status": "ACTIVE" + }, + "20220725-protocol-fee-percentages-provider": { + "contracts": [ + { + "name": "ProtocolFeePercentagesProvider", + "address": "0x4EEA4e1bA940BD93A98A674946905B36831d01D5" + } + ], + "status": "ACTIVE" + }, + "20221124-authorizer-adaptor-entrypoint": { + "contracts": [ + { + "name": "AuthorizerAdaptorEntrypoint", + "address": "0xbdfBEB1afcB6411d91A8dCCfC0ce293a53a20542" + } + ], + "status": "ACTIVE" + }, + "20230320-weighted-pool-v4": { + "contracts": [ + { + "name": "WeightedPoolFactory", + "address": "0xbd5A48ED2c877033EF379e342eC9c6fe16dC5710" + }, + { + "name": "MockWeightedPool", + "address": "0x2659c88DDB5B03224E10404258F3F2d2F1c85C60" + } + ], + "status": "ACTIVE" + }, + "20230414-authorizer-wrapper": { + "contracts": [ + { + "name": "AuthorizerWithAdaptorValidation", + "address": "0x5cbA76e20467742BCbbB38D2d14e16B66C2CAc0a" + } + ], + "status": "ACTIVE" + }, + "20230711-composable-stable-pool-v5": { + "contracts": [ + { + "name": "ComposableStablePoolFactory", + "address": "0x7aa0DBFaCa97734F4E4Ae5DF0E3f2f957D76018F" + }, + { + "name": "MockComposableStablePool", + "address": "0x4f2E1EBaa28e1053234d837e032536Dc39EA15D5" + } + ], + "status": "ACTIVE" + }, + "20231031-batch-relayer-v6": { + "contracts": [ + { + "name": "BatchRelayerLibrary", + "address": "0x61e6106CE69DdFDda28AaE767d889aF1E396d32a" + }, + { + "name": "BatchRelayerQueryLibrary", + "address": "0x65b457d134EE5Ba6a5De9202835E0523d2424E3E" + }, + { + "name": "BalancerRelayer", + "address": "0xB35B39Be5B520E40Ad67435168Cfd3DA86B1ED55" + } + ], + "status": "ACTIVE" + }, + "20231122-tsymm-token": { + "contracts": [ + { + "name": "SymmToken", + "address": "0x663345e09F4F4437F3D5df39BA5c2B5690532206" + } + ], + "status": "ACTIVE" + } +} diff --git a/src/lib/scripts/addresses-temp.json b/src/lib/scripts/addresses-telos.json similarity index 100% rename from src/lib/scripts/addresses-temp.json rename to src/lib/scripts/addresses-telos.json diff --git a/src/lib/scripts/contract-addresses.generator.ts b/src/lib/scripts/contract-addresses.generator.ts index 6baf09129..580c15b9f 100644 --- a/src/lib/scripts/contract-addresses.generator.ts +++ b/src/lib/scripts/contract-addresses.generator.ts @@ -46,10 +46,22 @@ type ContractMap = Record; // } // })(); +interface Contract { + name: string; + address: string; +} + +interface AddressValue { + contracts: Contract[]; +} + +type Addresses = Record; + async function generate() { - const network = 'telos'; + const network = 'meter'; + console.log(`Generating contract addresses for network ${network}...`); - const addresses: any = require(`./addresses-temp.json`); + const addresses: Addresses = require(`./addresses-${network}.json`); const contracts: ContractMap = {}; for (const [, value] of Object.entries(addresses)) { diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index ca29f1bdf..a75264033 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -144,7 +144,7 @@ export function isSameAddress(address1: string, address2: string): boolean { } export function includesAddress(addresses: string[], address: string): boolean { - if (!address) return false; + if (!address || !addresses) return false; addresses = addresses.map(a => (a ? getAddress(a) : '')); return addresses.includes(getAddress(address)); } diff --git a/src/pages/index.vue b/src/pages/index.vue index 4ea5518b1..fc98e08de 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -4,7 +4,7 @@ import axios from 'axios'; //import HomePageHero from '@/components/heros/HomePageHero.vue'; import TokenSearchInput from '@/components/inputs/TokenSearchInput.vue'; -import FeaturedProtocols from '@/components/sections/FeaturedProtocols.vue'; +// import FeaturedProtocols from '@/components/sections/FeaturedProtocols.vue'; import PoolsTable from '@/components/tables/PoolsTable/PoolsTable.vue'; import usePoolFilters from '@/composables/pools/usePoolFilters'; import useBreakpoints from '@/composables/useBreakpoints'; @@ -47,8 +47,8 @@ const filterPoolAttributes = ref([]); */ const router = useRouter(); const { injectPrices, getToken, tokens } = useTokens(); -const { appNetworkConfig } = useNetwork(); -const isElementSupported = appNetworkConfig.supportsElementPools; +// const { appNetworkConfig } = useNetwork(); +// const isElementSupported = appNetworkConfig.supportsElementPools; const { selectedTokens, addSelectedToken, removeSelectedToken } = usePoolFilters(); @@ -195,7 +195,9 @@ watch(poolTypeFilter, newPoolTypeFilter => { }); onBeforeMount(async () => { - await getTokenPrices(); + if (networkSlug === 'telos') { + await getTokenPrices(); + } }); @@ -334,13 +336,13 @@ onBeforeMount(async () => { @on-column-sort="onColumnSort" @load-more="loadMorePools" /> -
+
diff --git a/src/plugins/router/nav-guards.ts b/src/plugins/router/nav-guards.ts index 0e633a751..a17d1f21f 100644 --- a/src/plugins/router/nav-guards.ts +++ b/src/plugins/router/nav-guards.ts @@ -1,4 +1,5 @@ import { ref } from 'vue'; +import { useFavicon } from '@vueuse/core'; import { // getRedirectUrlFor, handleNetworkSlug, @@ -92,7 +93,7 @@ function applyNetworkPathRedirects(router: Router): Router { const networkChangeCallback = () => { hardRedirectTo(`/#${to.fullPath}`); }; - + useFavicon(`/${networkSlugFromUrl}-favicon.png`); handleNetworkSlug( networkSlugFromUrl, noNetworkChangeCallback, diff --git a/src/providers/tokens.provider.ts b/src/providers/tokens.provider.ts index 2db9d3982..7e7d26a1a 100644 --- a/src/providers/tokens.provider.ts +++ b/src/providers/tokens.provider.ts @@ -43,6 +43,7 @@ import useWeb3 from '@/services/web3/useWeb3'; import { tokenListService } from '@/services/token-list/token-list.service'; import { AmountToApprove } from '@/composables/approvals/useTokenApprovalActions'; import BigNumber from 'bignumber.js'; +// import { Token } from '@symmetric-v3/sdk'; const { uris: tokenListUris } = tokenListService; @@ -454,6 +455,7 @@ export const tokensProvider = ( * Get single token from state */ function getToken(address: string): TokenInfo { + if (!address) return { address: '' } as TokenInfo; address = getAddressFromPoolId(address); // In case pool ID has been passed return selectByAddressFast(tokens.value, getAddress(address)) as TokenInfo; } @@ -498,6 +500,9 @@ export const tokensProvider = ( * Returns true if the token is the native asset or wrapped native asset */ function isWethOrEth(tokenAddress: string): boolean { + console.log(wrappedNativeAsset.value); + if (!nativeAsset || !nativeAsset.address || !wrappedNativeAsset.value) + return false; return ( isSameAddress(tokenAddress, nativeAsset.address) || isSameAddress(tokenAddress, wrappedNativeAsset.value.address) diff --git a/src/services/config/config.service.ts b/src/services/config/config.service.ts index 226ee2aad..5ad68947f 100644 --- a/src/services/config/config.service.ts +++ b/src/services/config/config.service.ts @@ -21,7 +21,7 @@ export default class ConfigService { public get env(): Env { return { APP_ENV: import.meta.env.VITE_ENV || 'development', - APP_DOMAIN: import.meta.env.VITE_DOMAIN || 'telos.symm.fi', + APP_DOMAIN: import.meta.env.VITE_DOMAIN || 'app.symm.fi', APP_HOST: import.meta.env.VITE_HOST || 'symm.fi', API_URL: import.meta.env.VITE_API_URL || 'https://api-v3.balancer.fi/graphql', diff --git a/src/services/pool/decorators/pool.decorator.ts b/src/services/pool/decorators/pool.decorator.ts index 08144b2d7..cca394b94 100644 --- a/src/services/pool/decorators/pool.decorator.ts +++ b/src/services/pool/decorators/pool.decorator.ts @@ -6,6 +6,7 @@ import { TokenInfoMap } from '@/types/TokenList'; import PoolService from '../pool.service'; import { PoolMulticaller } from './pool.multicaller'; import axios from 'axios'; +import { configService } from '@/services/config/config.service'; /** * @summary Decorates a set of pools with additonal data. @@ -21,26 +22,28 @@ export class PoolDecorator { tokens: TokenInfoMap, fullDecoration = true ): Promise { - const rewardData: any = localStorage.getItem('REWARD_PRICE'); - if (rewardData) { - const { timestamp } = JSON.parse(rewardData); - if (isPriceOutdated(timestamp)) { + if (configService.network.chainId === 40) { + const rewardData: any = localStorage.getItem('REWARD_PRICE'); + if (rewardData) { + const { timestamp } = JSON.parse(rewardData); + if (isPriceOutdated(timestamp)) { + setRewardPriceInLocalStorage() + .then(() => { + console.log('REWARD_PRICE has been updated in local storage'); + }) + .catch(error => { + console.error('Error:', error); + }); + } + } else { setRewardPriceInLocalStorage() .then(() => { - console.log('REWARD_PRICE has been updated in local storage'); + console.log('REWARD_PRICE has been set in local storage'); }) .catch(error => { console.error('Error:', error); }); } - } else { - setRewardPriceInLocalStorage() - .then(() => { - console.log('REWARD_PRICE has been set in local storage'); - }) - .catch(error => { - console.error('Error:', error); - }); } const processedPools = this.pools.map(pool => { const poolService = new this.poolServiceClass(pool); @@ -63,7 +66,6 @@ export class PoolDecorator { // decoration of them if the pool came from the API. if (fullDecoration) { const poolSnapshot = poolSnapshots.find(p => p.id === pool.id); - console.log(poolSnapshot); poolService.setFeesSnapshot(poolSnapshot); poolService.setVolumeSnapshot(poolSnapshot); await poolService.setTotalLiquidity(); diff --git a/src/services/web3/connectors/trustwallet/walletconnect.connector.ts b/src/services/web3/connectors/trustwallet/walletconnect.connector.ts index f1d60d6f8..83d1c8a27 100644 --- a/src/services/web3/connectors/trustwallet/walletconnect.connector.ts +++ b/src/services/web3/connectors/trustwallet/walletconnect.connector.ts @@ -16,6 +16,7 @@ const { // ZKEVM, TELOS, TELOSTESTNET, + CELO, } = Network; export class WalletConnectConnector extends Connector { @@ -23,7 +24,7 @@ export class WalletConnectConnector extends Connector { async connect() { const provider = await EthereumProvider.init({ projectId: '90da6e11e9ce2448f2872dae5e52b189', - chains: [TELOS], + chains: [TELOS, CELO], optionalChains: [ // AVALANCHE, // ARBITRUM, @@ -32,6 +33,7 @@ export class WalletConnectConnector extends Connector { // POLYGON, // ZKEVM, TELOSTESTNET, + CELO, ], rpcMap: { // [MAINNET]: configService.getNetworkRpc(MAINNET), @@ -43,6 +45,7 @@ export class WalletConnectConnector extends Connector { // [ZKEVM]: configService.getNetworkRpc(ZKEVM), [TELOS]: configService.getNetworkRpc(TELOS), [TELOSTESTNET]: configService.getNetworkRpc(TELOSTESTNET), + [CELO]: configService.getNetworkRpc(CELO), }, showQrModal: true, qrModalOptions: { themeMode: useDarkMode().darkMode ? 'dark' : 'light' }, diff --git a/src/services/web3/wallet.service.ts b/src/services/web3/wallet.service.ts index 0124936a9..190615f1a 100644 --- a/src/services/web3/wallet.service.ts +++ b/src/services/web3/wallet.service.ts @@ -26,7 +26,7 @@ export default class WalletService { private readonly config: ConfigService = configService ) { this.appProvider = this.rpcProviderService.jsonProvider; - this.ensProvider = this.rpcProviderService.getJsonProvider(Network.TELOS); + this.ensProvider = this.rpcProviderService.getJsonProvider(Network.CELO); } public setUserProvider(provider: ComputedRef) {