From 079ef659d1414d7cef47d19a615004ce165c6e00 Mon Sep 17 00:00:00 2001 From: JimmyDummy <106658431+JimmyDummy@users.noreply.github.com> Date: Sun, 25 Jun 2023 15:04:51 +0400 Subject: [PATCH 1/6] feat: update pools.ts to include 80BIDS-20WETH --- src/lib/config/mainnet/pools.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/config/mainnet/pools.ts b/src/lib/config/mainnet/pools.ts index eb071c4f03..9ef9036516 100644 --- a/src/lib/config/mainnet/pools.ts +++ b/src/lib/config/mainnet/pools.ts @@ -137,6 +137,7 @@ const pools: Pools = { '0x26c2b83fc8535deead276f5cc3ad9c1a2192e02700020000000000000000056b', // OHM/bbaDAI '0x18fdf15ff782e44c1f9b6c5846ff6b0f0004f6a2000200000000000000000560', // OHM/LUSD '0x3b9fb87f7d081ceddb1289258fa5660d955317b6000200000000000000000544', // baoeth/bao + '0xd8721e92ba0f8235b375e9ec9a7b697ec4e2d6c6000200000000000000000575', // 80BIDS-20WETH ], }, Factories: { From e365750a4ffb63559066cdbaa616580662ac0ff7 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 26 Jun 2023 05:06:46 +0000 Subject: [PATCH 2/6] 1.108.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76b3d68afe..b6d1d839b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@balancer/frontend-v2", - "version": "1.108.8", + "version": "1.108.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@balancer/frontend-v2", - "version": "1.108.8", + "version": "1.108.9", "license": "MIT", "devDependencies": { "@aave/protocol-js": "^4.3.0", diff --git a/package.json b/package.json index f5623d86cf..adefb829c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer/frontend-v2", - "version": "1.108.8", + "version": "1.108.9", "engines": { "node": "=16", "npm": ">=8" From 16c8db0b01b0055a3842b88b3820b5f00bafda3a Mon Sep 17 00:00:00 2001 From: Alberto Gualis Date: Mon, 26 Jun 2023 15:07:53 +0200 Subject: [PATCH 3/6] Release 1.109.0 (#3580) * Add automatic workflow for allowlist * Change inputs * Updated risks page: Rate provider bridges (#3533) * Updated risks page: Rate provider bridges * chore: Refactor risks for risk keys * chore: Use RiskKey * chore: Fix risk tests * chore: Use risk keys as ids * chore: Add pool risk list component * chore: Cleanup risks section * chore: Fix tests * Fix Composable Stable risk link --------- Co-authored-by: Gareth Fuller Co-authored-by: Alberto Gualis * Add 80mooMvxMVLP-20wUSDR pool This pool is designed to make the mooMvxMVLP directly trade-able without having to withdraw from the compounding vault. It is intended for use in other balancer pools as a high yield managed portfolio token. * Move hardcoded config from voting gauge generator to config files * Add NodeJS version check * Add error if VITE_RPC_URL_1 is not set * additional gauge updates * add reth/weth pool to allowlist * Fixed broken veBAL learn more link * Added boosted pool icons to Polygon zkevm pools * Improve Allowlisting * Updated Polygon zkEVM promo message (#3576) * Update allow list (#3577) * Allowlist 50ETHx-50WETH and 80BIDS-20WETH in mainnet. * Allowlist uniETH-WETH in goerli. * Allowlist STARV2-SuperPoolV1 in polygon (#3579) * 1.109.0 --------- Co-authored-by: Tim Robinson Co-authored-by: pkattera Co-authored-by: Gareth Fuller Co-authored-by: Anastasios Co-authored-by: Tim Robinson Co-authored-by: dakotajakiser <31942806+dakotajakiser@users.noreply.github.com> Co-authored-by: ZeKraken <79888567+zekraken-bot@users.noreply.github.com> --- .github/workflows/allowlist-manual.yml | 38 ++++ .github/workflows/allowlist-webhook.yml | 14 ++ .github/workflows/allowlist.yml | 27 +-- package-lock.json | 4 +- package.json | 2 +- src/assets/images/icons/protocols/0vix.svg | 1 + .../pages/pool/risks/PoolRiskList.vue | 17 ++ .../contextual/pages/pool/risks/PoolRisks.vue | 39 ++-- .../contextual/pages/pools/ZkevmPromo.vue | 8 +- .../contextual/pages/vebal/Hero.vue | 2 +- src/composables/useBoostedPool.ts | 5 + .../usePoolRisks.spec.ts} | 44 +++-- .../usePoolRisks.ts} | 89 +++++---- src/lib/config/arbitrum/index.ts | 1 + src/lib/config/arbitrum/pools.ts | 2 + src/lib/config/gnosis-chain/index.ts | 1 + src/lib/config/goerli/index.ts | 1 + src/lib/config/goerli/pools.ts | 8 +- src/lib/config/mainnet/index.ts | 1 + src/lib/config/mainnet/pools.ts | 4 + src/lib/config/optimism/index.ts | 1 + src/lib/config/polygon/index.ts | 1 + src/lib/config/polygon/pools.ts | 2 + src/lib/config/types.ts | 1 + src/lib/config/zkevm/index.ts | 1 + src/lib/config/zkevm/pools.ts | 29 ++- src/lib/scripts/voting-gauge.generator.ts | 39 ++-- src/pages/risks.vue | 179 ++++++++++-------- src/types/pools.ts | 31 ++- 29 files changed, 394 insertions(+), 198 deletions(-) create mode 100644 .github/workflows/allowlist-manual.yml create mode 100644 .github/workflows/allowlist-webhook.yml create mode 100644 src/assets/images/icons/protocols/0vix.svg create mode 100644 src/components/contextual/pages/pool/risks/PoolRiskList.vue rename src/{components/contextual/pages/pool/risks/pool-risks.spec.ts => composables/usePoolRisks.spec.ts} (84%) rename src/{components/contextual/pages/pool/risks/pool-risks.ts => composables/usePoolRisks.ts} (52%) diff --git a/.github/workflows/allowlist-manual.yml b/.github/workflows/allowlist-manual.yml new file mode 100644 index 0000000000..c45c27fb24 --- /dev/null +++ b/.github/workflows/allowlist-manual.yml @@ -0,0 +1,38 @@ +name: Allowlist pool + +on: + workflow_dispatch: + inputs: + network: + type: choice + description: Network + required: true + options: + - mainnet + - polygon + - arbitrum + - gnosis-chain + poolType: + type: choice + description: Pool Type + required: true + options: + - Weighted + - Stable + poolId: + type: string + description: Pool ID + required: true + poolDescription: + type: string + description: Pool Description + required: false + +jobs: + allowlist-pool: + uses: ./.github/workflows/allowlist.yml + with: + network: ${{ github.event.inputs.network }} + poolType: ${{ github.event.inputs.poolType }} + poolId: ${{ github.event.inputs.poolId }} + poolDescription: ${{ github.event.inputs.poolDescription }} diff --git a/.github/workflows/allowlist-webhook.yml b/.github/workflows/allowlist-webhook.yml new file mode 100644 index 0000000000..55d218fbe2 --- /dev/null +++ b/.github/workflows/allowlist-webhook.yml @@ -0,0 +1,14 @@ +name: Allowlist Pool Webhook + +on: + repository_dispatch: + types: ['allowlist_pool'] + +jobs: + allowlist-pool: + uses: ./.github/workflows/allowlist.yml + with: + network: ${{ github.event.client_payload.network }} + poolType: ${{ github.event.client_payload.poolType }} + poolId: ${{ github.event.client_payload.poolId }} + poolDescription: ${{ github.event.client_payload.poolDescription }} \ No newline at end of file diff --git a/.github/workflows/allowlist.yml b/.github/workflows/allowlist.yml index 0e256d21d0..f660124c88 100644 --- a/.github/workflows/allowlist.yml +++ b/.github/workflows/allowlist.yml @@ -1,37 +1,24 @@ name: Allowlist pool on: - workflow_dispatch: + workflow_call: inputs: network: - type: choice - description: Network + type: string required: true - options: - - mainnet - - polygon - - arbitrum - - gnosis-chain poolType: - type: choice - description: Pool Type + type: string required: true - options: - - Weighted - - Stable poolId: type: string - description: Pool ID required: true poolDescription: type: string - description: Pool Description required: false jobs: allowlist-pool: runs-on: ubuntu-latest - steps: - name: Checkout repo uses: actions/checkout@v3 @@ -44,21 +31,21 @@ jobs: - name: Install deps run: npm install cac - name: Run allowlist script - run: npx vite-node ./src/lib/scripts/automatic-prs/allowlist-pool.ts --network ${{github.event.inputs.network}} --poolType ${{github.event.inputs.poolType}} --poolId \"${{github.event.inputs.poolId}}\" --poolDescription "${{github.event.inputs.poolDescription}}" + run: npx vite-node ./src/lib/scripts/automatic-prs/allowlist-pool.ts --network ${{inputs.network}} --poolType ${{inputs.poolType}} --poolId \"${{inputs.poolId}}\" --poolDescription "${{inputs.poolDescription}}" - name: Run eslint fix of updated config files run: npm run lint:fix:config - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: 'chore: Update allowlist' + commit-message: 'chore: Add ${{inputs.poolDescription}} pool to ${{inputs.network}} allowlist' committer: GitHub author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> signoff: false - branch: update-allowlist + branch: update-allowlist-${{inputs.network}}-${{inputs.poolId}} base: master delete-branch: true - title: 'Update pool allowlist' + title: 'Allowlist ${{inputs.poolDescription}} pool' body: | This PR was autogenerated by the allowlist manual Github action. draft: false diff --git a/package-lock.json b/package-lock.json index b6d1d839b3..a762f7af6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@balancer/frontend-v2", - "version": "1.108.9", + "version": "1.109.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@balancer/frontend-v2", - "version": "1.108.9", + "version": "1.109.0", "license": "MIT", "devDependencies": { "@aave/protocol-js": "^4.3.0", diff --git a/package.json b/package.json index adefb829c9..f5dfefb43a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer/frontend-v2", - "version": "1.108.9", + "version": "1.109.0", "engines": { "node": "=16", "npm": ">=8" diff --git a/src/assets/images/icons/protocols/0vix.svg b/src/assets/images/icons/protocols/0vix.svg new file mode 100644 index 0000000000..52b52d81cf --- /dev/null +++ b/src/assets/images/icons/protocols/0vix.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/contextual/pages/pool/risks/PoolRiskList.vue b/src/components/contextual/pages/pool/risks/PoolRiskList.vue new file mode 100644 index 0000000000..c9f253e253 --- /dev/null +++ b/src/components/contextual/pages/pool/risks/PoolRiskList.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/components/contextual/pages/pool/risks/PoolRisks.vue b/src/components/contextual/pages/pool/risks/PoolRisks.vue index 9c0e4c6e33..f43e6bbd3e 100644 --- a/src/components/contextual/pages/pool/risks/PoolRisks.vue +++ b/src/components/contextual/pages/pool/risks/PoolRisks.vue @@ -1,6 +1,11 @@ diff --git a/src/components/contextual/pages/pools/ZkevmPromo.vue b/src/components/contextual/pages/pools/ZkevmPromo.vue index 0ab697388e..1399778680 100644 --- a/src/components/contextual/pages/pools/ZkevmPromo.vue +++ b/src/components/contextual/pages/pools/ZkevmPromo.vue @@ -14,12 +14,12 @@ const { networkSlug } = useNetwork(); >
- Balancer is live on Polygon zkEVM + Get ready for BAL incentives for Polygon zkEVM

- Polygon zkEVM Beta harnesses the power of ZK proofs to reduce - transaction cost and massively increase throughput, all while - inheriting the security of Ethereum L1. + BAL incentives on selected Polygon zkEVM pools go live on Thursday + 29 June. veBAL holders can vote for these pools now. LPs can prepare + by bridging and adding liquidity to the Polygon zkEVM network.

diff --git a/src/components/contextual/pages/vebal/Hero.vue b/src/components/contextual/pages/vebal/Hero.vue index 18bb87e49d..0ae902dcec 100644 --- a/src/components/contextual/pages/vebal/Hero.vue +++ b/src/components/contextual/pages/vebal/Hero.vue @@ -60,7 +60,7 @@ function navigateToGetVeBAL() { = { @@ -67,4 +68,8 @@ export const boostedProtocolIconPaths: Record = { '@/assets/images/icons/protocols/tetu.png', import.meta.url ).href, + [BoostedProtocol.Zerovix]: new URL( + '@/assets/images/icons/protocols/0vix.svg', + import.meta.url + ).href, }; diff --git a/src/components/contextual/pages/pool/risks/pool-risks.spec.ts b/src/composables/usePoolRisks.spec.ts similarity index 84% rename from src/components/contextual/pages/pool/risks/pool-risks.spec.ts rename to src/composables/usePoolRisks.spec.ts index 6052286425..e489655249 100644 --- a/src/components/contextual/pages/pool/risks/pool-risks.spec.ts +++ b/src/composables/usePoolRisks.spec.ts @@ -3,7 +3,7 @@ import { generateThirdPartyComposabilityRisks, riskLinks, risksTitle, -} from './pool-risks'; +} from './usePoolRisks'; import { aWeightedPool } from '@/__mocks__/weighted-pool'; import { aPool } from '@tests/unit/builders/pool.builders'; import { PoolType } from '@balancer-labs/sdk'; @@ -46,6 +46,10 @@ describe('Generates links for', () => { "hash": "#composability-risk", "title": "Third party DeFi composability risks: Aave, Morpho", }, + { + "hash": "#general-risks", + "title": "General Balancer protocol risks", + }, ] `); }); @@ -67,6 +71,10 @@ describe('Generates links for', () => { "hash": "#mutable-attributes-risk", "title": "Mutable attributes risks", }, + { + "hash": "#general-risks", + "title": "General Balancer protocol risks", + }, ] `); }); @@ -84,6 +92,10 @@ describe('Generates links for', () => { "hash": "#polygon", "title": "Layer 2 network risks: Polygon", }, + { + "hash": "#general-risks", + "title": "General Balancer protocol risks", + }, ] `); }); @@ -92,17 +104,21 @@ describe('Generates links for', () => { withGnosis(); expect(riskLinks(aPool({ poolType: PoolType.ComposableStable }))) .toMatchInlineSnapshot(` - [ - { - "hash": "#composable-pools", - "title": "Composable stable pool risks", - }, - { - "hash": "#gnosis", - "title": "Layer 2 network risks: Gnosis", - }, - ] - `); + [ + { + "hash": "#composable-pools", + "title": "Composable Stable pool risks", + }, + { + "hash": "#gnosis", + "title": "Layer 2 network risks: Gnosis", + }, + { + "hash": "#general-risks", + "title": "General Balancer protocol risks", + }, + ] + `); }); test('a composable stable pool with Delegate Owner', () => { @@ -114,6 +130,10 @@ describe('Generates links for', () => { "hash": "#composable-pools", "title": "MetaStable pool risks", }, + { + "hash": "#general-risks", + "title": "General Balancer protocol risks", + }, ] `); }); diff --git a/src/components/contextual/pages/pool/risks/pool-risks.ts b/src/composables/usePoolRisks.ts similarity index 52% rename from src/components/contextual/pages/pool/risks/pool-risks.ts rename to src/composables/usePoolRisks.ts index e32dfe6062..f173041eb6 100644 --- a/src/components/contextual/pages/pool/risks/pool-risks.ts +++ b/src/composables/usePoolRisks.ts @@ -15,43 +15,56 @@ import { } from '@/composables/usePoolHelpers'; import { POOLS } from '@/constants/pools'; import { Pool } from '@/services/pool/types'; +import { RiskKey } from '@/types/pools'; import { capitalize } from 'lodash'; -interface Risk { +export const riskTitles = { + [RiskKey.General]: 'General Balancer protocol risks', + [RiskKey.Weighted]: 'Weighted pool risks', + [RiskKey.Stable]: 'Stable pool risks', + [RiskKey.ComposableStable]: 'Composable stable pool risks', + [RiskKey.MetaStable]: 'MetaStable pool risks', + [RiskKey.Boosted]: 'Boosted pool risks', + [RiskKey.Arbitrum]: 'Layer 2 network risks: Arbitrum', + [RiskKey.Polygon]: 'Layer 2 network risks: Polygon', + [RiskKey.Optimism]: 'Layer 2 network risks: Optimism', + [RiskKey.Gnosis]: 'Layer 2 network risks: Gnosis', + [RiskKey.Mutable]: 'Mutable attributes risks', + [RiskKey.Composability]: 'Composability risks', + [RiskKey.RateProvider]: 'Rate provider risks', + [RiskKey.RateProviderBridge]: + 'Rate provider cross-chain bridge risks: Layer Zero', +}; + +export interface Risk { title: string; hash: string; } -function aLink(title: string, hash: string) { +function aLink(key: RiskKey, title?: string) { return { - title, - hash, + title: title || riskTitles[key], + hash: `#${key}`, }; } // Pool type risks -const weightedRisks = aLink('Weighted pool risks', '#weighted-pools'); -const stableRisks = aLink('Stable pool risks', '#stable-pools'); +const weightedRisks = aLink(RiskKey.Weighted); +const stableRisks = aLink(RiskKey.Stable); const composableRisks = aLink( - 'Composable stable pool risks', - '#composable-pools' + RiskKey.ComposableStable, + // Explicit title because RiskKey.ComposableStable and RiskKey.MetaStable share the same key (hash) + 'Composable Stable pool risks' ); -const metaStableRisks = aLink('MetaStable pool risks', '#composable-pools'); -const boostedRisks = aLink('Boosted pool risks', '#boosted-pools'); - -// L2 risks -const arbitrumRisks = aLink('Layer 2 network risks: Arbitrum', '#arbitrum'); -const polygonRisks = aLink('Layer 2 network risks: Polygon', '#polygon'); -const optimismRisks = aLink('Layer 2 network risks: Optimism', '#optimism'); -const gnosisRisks = aLink('Layer 2 network risks: Gnosis', '#gnosis'); - -// Mutable risks -const mutableRisks = aLink( - 'Mutable attributes risks', - '#mutable-attributes-risk' -); - -export function riskLinks(pool: Pool) { +const metaStableRisks = aLink(RiskKey.MetaStable); +const boostedRisks = aLink(RiskKey.Boosted); +const arbitrumRisks = aLink(RiskKey.Arbitrum); +const polygonRisks = aLink(RiskKey.Polygon); +const optimismRisks = aLink(RiskKey.Optimism); +const gnosisRisks = aLink(RiskKey.Gnosis); +const mutableRisks = aLink(RiskKey.Mutable); + +export function riskLinks(pool: Pool): Risk[] { const result: Risk[] = []; if (isWeighted(pool.poolType)) result.push(weightedRisks); @@ -72,6 +85,8 @@ export function riskLinks(pool: Pool) { if (hasOwner(pool)) result.push(mutableRisks); + result.push(aLink(RiskKey.General)); + return result; } @@ -83,8 +98,8 @@ export function generateThirdPartyComposabilityRisks(pool): Risk | undefined { protocols?.includes(BoostedProtocol.Idle) ) return aLink( - 'Third party DeFi composability risks: May use multiple yield protocols', - '#composability-risk' + RiskKey.Composability, + 'Third party DeFi composability risks: May use multiple yield protocols' ); if (protocols?.includes(BoostedProtocol.Reaper)) @@ -92,10 +107,10 @@ export function generateThirdPartyComposabilityRisks(pool): Risk | undefined { if (protocols) { return aLink( + RiskKey.Composability, `Third party DeFi composability risks: ${protocols .map(protocol => capitalize(protocol)) - .join(', ')}`, - '#composability-risk' + .join(', ')}` ); } } @@ -111,16 +126,16 @@ export function risksTitle(pool: Pool) { } function alsoWhenSpecificRisks(pool: Pool) { - if (poolSpecificRisks(pool)) return ' also'; + if (poolSpecificRisks(pool).length > 0) return ' also'; return ''; } -export function poolSpecificRisks(pool: Pool) { - // GOERLI ID for testing - if ( - pool.id === - '0x5aee1e99fe86960377de9f88689616916d5dcabe000000000000000000000467' - ) - return 'This pool has testing specific risks.'; - return ''; +export function poolSpecificRisks(pool: Pool): Risk[] { + const risks = POOLS?.Risks?.[pool.id.toLowerCase()]; + + if (risks) { + return risks.map(risk => aLink(risk)); + } + + return []; } diff --git a/src/lib/config/arbitrum/index.ts b/src/lib/config/arbitrum/index.ts index 1f3c495598..d917cae95c 100644 --- a/src/lib/config/arbitrum/index.ts +++ b/src/lib/config/arbitrum/index.ts @@ -15,6 +15,7 @@ const config: Config = { monorepoName: 'arbitrum', slug: 'arbitrum', network: 'arbitrum-one', + trustWalletNetwork: 'arbitrum', unknown: false, visibleInUI: true, testNetwork: false, diff --git a/src/lib/config/arbitrum/pools.ts b/src/lib/config/arbitrum/pools.ts index e9c355fc0e..e0d2786638 100644 --- a/src/lib/config/arbitrum/pools.ts +++ b/src/lib/config/arbitrum/pools.ts @@ -45,6 +45,7 @@ const pools: Pools = { '0x542f16da0efb162d20bf4358efa095b70a100f9e000000000000000000000436', // tbtc '0x567ecfcb22205d279bb8eed3e066989902bf03d5000000000000000000000452', // dola/bb-a-usd '0x8bc65eed474d1a00555825c91feab6a8255c2107000000000000000000000453', // dola/usdc + '0x01990f1e6f7f32296f125ee9469705c1c070054d000000000000000000000461', // reth/WETH ], }, Investment: { @@ -73,6 +74,7 @@ const pools: Pools = { '0xd0dc20e6342db2de82692b8dc842301ff9121805000200000000000000000454', // nfte/wsteth-bb-a-weth '0xbcaa6c053cab3dd73a2e898d89a4f84a180ae1ca000100000000000000000458', // bal/arb/aura '0xc7fa3a3527435720f0e2a4c1378335324dd4f9b3000200000000000000000459', // auraBAL/wstETH + '0x93b48e950380adcf6d67c392f20d44fb88d258dc000200000000000000000465', // usdc.e/usdc ], }, Factories: { diff --git a/src/lib/config/gnosis-chain/index.ts b/src/lib/config/gnosis-chain/index.ts index 1ecfcfd692..42d99d7084 100644 --- a/src/lib/config/gnosis-chain/index.ts +++ b/src/lib/config/gnosis-chain/index.ts @@ -14,6 +14,7 @@ const config: Config = { monorepoName: 'gnosis', slug: 'gnosis-chain', network: 'gnosis-chain', + trustWalletNetwork: 'xdai', unknown: false, visibleInUI: true, testNetwork: false, diff --git a/src/lib/config/goerli/index.ts b/src/lib/config/goerli/index.ts index b01d803b99..cae8a9c517 100644 --- a/src/lib/config/goerli/index.ts +++ b/src/lib/config/goerli/index.ts @@ -15,6 +15,7 @@ const config: Config = { monorepoName: 'goerli', slug: 'goerli', network: 'goerli', + trustWalletNetwork: 'goerli', unknown: false, visibleInUI: true, testNetwork: true, diff --git a/src/lib/config/goerli/pools.ts b/src/lib/config/goerli/pools.ts index c24f470c17..2d3657a95b 100644 --- a/src/lib/config/goerli/pools.ts +++ b/src/lib/config/goerli/pools.ts @@ -1,5 +1,5 @@ import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { Pools } from '@/types/pools'; +import { Pools, RiskKey } from '@/types/pools'; export const poolIdThatRequiresInternalBalanceExit = '0xd4e7c1f3da1144c9e2cfd1b015eda7652b4a439900000000000000000000046a'; @@ -64,6 +64,7 @@ const pools: Pools = { '0x00a62d31b6c776b6813543bc99ff265f7222dbe100000000000000000000011e', '0x0c925fce89a22e36ebd9b3c6e0262234e853d2f600000000000000000000019c', '0x1542b8783e5e884b6fe7422dd2f71a42c5edb86d0000000000000000000002f3', + '0xa7c0335079841076dfff02f621730927e896dd9700020000000000000000083a', // uniETH / WETH ], }, Investment: { @@ -148,6 +149,11 @@ const pools: Pools = { deprecatedid: {}, //Used for unit testing }, ExitViaInternalBalance: [poolIdThatRequiresInternalBalanceExit], + Risks: { + '0x5aee1e99fe86960377de9f88689616916d5dcabe000000000000000000000467': [ + RiskKey.RateProviderBridge, + ], + }, }; export default pools; diff --git a/src/lib/config/mainnet/index.ts b/src/lib/config/mainnet/index.ts index a05192667b..538fe5aba0 100644 --- a/src/lib/config/mainnet/index.ts +++ b/src/lib/config/mainnet/index.ts @@ -15,6 +15,7 @@ const config: Config = { monorepoName: 'mainnet', slug: 'ethereum', network: 'mainnet', + trustWalletNetwork: 'ethereum', unknown: false, visibleInUI: true, testNetwork: false, diff --git a/src/lib/config/mainnet/pools.ts b/src/lib/config/mainnet/pools.ts index 9ef9036516..a651a555b3 100644 --- a/src/lib/config/mainnet/pools.ts +++ b/src/lib/config/mainnet/pools.ts @@ -102,6 +102,8 @@ const pools: Pools = { '0xc5dc1316ab670a2eed5716d7f19ced321191f38200000000000000000000056e', // wstETH/morpho weth '0x156c02f3f7fef64a3a9d80ccf7085f23cce91d76000000000000000000000570', // vETH/WETH '0x0bbc7b78ff8453c40718e290b33f1d00ee67274e000000000000000000000563', // baoeth/beth + '0x911fc393355fe415a667893d55fff6703c57c72e000200000000000000000574', // 50ETHx-50WETH + '0xd8721e92ba0f8235b375e9ec9a7b697ec4e2d6c6000200000000000000000575', // 80BIDS-20WETH ], }, Investment: { @@ -138,6 +140,8 @@ const pools: Pools = { '0x18fdf15ff782e44c1f9b6c5846ff6b0f0004f6a2000200000000000000000560', // OHM/LUSD '0x3b9fb87f7d081ceddb1289258fa5660d955317b6000200000000000000000544', // baoeth/bao '0xd8721e92ba0f8235b375e9ec9a7b697ec4e2d6c6000200000000000000000575', // 80BIDS-20WETH + '0x4729f67394030472e853cb61954fe784bfb36c3b000100000000000000000569', // 25WBTC-50USDC-25WETH + '0x911fc393355fe415a667893d55fff6703c57c72e000200000000000000000574', // 50ETHx-50WETH ], }, Factories: { diff --git a/src/lib/config/optimism/index.ts b/src/lib/config/optimism/index.ts index 9b626736b2..bfd71c11ef 100644 --- a/src/lib/config/optimism/index.ts +++ b/src/lib/config/optimism/index.ts @@ -13,6 +13,7 @@ const config: Config = { monorepoName: 'optimism', slug: 'optimism', network: 'optimism', + trustWalletNetwork: 'optimism', unknown: false, visibleInUI: false, testNetwork: false, diff --git a/src/lib/config/polygon/index.ts b/src/lib/config/polygon/index.ts index 2148e3f840..51b9bbbe82 100644 --- a/src/lib/config/polygon/index.ts +++ b/src/lib/config/polygon/index.ts @@ -15,6 +15,7 @@ const config: Config = { monorepoName: 'polygon', slug: 'polygon', network: 'polygon', + trustWalletNetwork: 'polygon', unknown: false, visibleInUI: true, testNetwork: false, diff --git a/src/lib/config/polygon/pools.ts b/src/lib/config/polygon/pools.ts index 03af1efa02..c68a5ed744 100644 --- a/src/lib/config/polygon/pools.ts +++ b/src/lib/config/polygon/pools.ts @@ -114,6 +114,8 @@ const pools: Pools = { '0x9841438683c2efbfb28c94ec341544b94e4f6dd5000100000000000000000b8f', // WBTC/USDC/PAXG/WETH '0x945f337307ea76fdaa2590d083423850f64e247f000100000000000000000b98', // 27wstETH-7WMATIC-25WBTC-7USDC-18stMATIC-8WETH-8DAI '0xd7786ac3f9071ddacaf9a5b0bf443c58f8d6cf67000100000000000000000ba8', // 25MKR-25WETH-25DAI-25NEX + '0x7f6a9b65cf1fc091b0e012c2908f0f711dfc95b5000200000000000000000bab', // 80mooMvxMVLP-20wUSDR + '0xed35f28f837e96f81240ebb82e0e3f518c7e8a2f000100000000000000000bb5', // STARV2-SuperPoolV1 ], }, Factories: { diff --git a/src/lib/config/types.ts b/src/lib/config/types.ts index 4c8b3af6bd..4df53defe4 100644 --- a/src/lib/config/types.ts +++ b/src/lib/config/types.ts @@ -75,6 +75,7 @@ export interface Config { monorepoName?: string; slug: string; network: string; + trustWalletNetwork?: string; unknown: boolean; visibleInUI: boolean; testNetwork: boolean; diff --git a/src/lib/config/zkevm/index.ts b/src/lib/config/zkevm/index.ts index 1ef9c84197..fca9681ec3 100644 --- a/src/lib/config/zkevm/index.ts +++ b/src/lib/config/zkevm/index.ts @@ -15,6 +15,7 @@ const config: Config = { monorepoName: 'zkevm', slug: 'zkevm', network: 'polygon-zkevm', + trustWalletNetwork: 'polygonzkevm', unknown: false, visibleInUI: true, testNetwork: false, diff --git a/src/lib/config/zkevm/pools.ts b/src/lib/config/zkevm/pools.ts index 6764b2bd3a..8606fb730a 100644 --- a/src/lib/config/zkevm/pools.ts +++ b/src/lib/config/zkevm/pools.ts @@ -1,4 +1,5 @@ -import { Pools } from '@/types/pools'; +import { BoostedProtocol } from '@/composables/useBoostedPool'; +import { Pools, RiskKey } from '@/types/pools'; const pools: Pools = { IdsMap: {}, @@ -77,12 +78,14 @@ const pools: Pools = { '0xe274c9deb6ed34cfe4130f8d0a8a948dea5bb28600000000000000000000000d': { name: 'Balancer Boosted 0vix USD', hasIcon: false, - boosted: false, + boosted: true, + boostedProtocols: [BoostedProtocol.Zerovix], }, '0x68a69c596b3839023c0e08d09682314f582314e5000200000000000000000011': { name: 'wstETH/weth/Boosted 0vix USD', hasIcon: false, - boosted: false, + boosted: true, + boostedProtocols: [BoostedProtocol.Zerovix], }, '0x9e2d87f904862671eb49cb358e74284762cc9f42000200000000000000000013': { name: 'wstETH/Boosted 0vix USD', @@ -92,7 +95,8 @@ const pools: Pools = { '0x6f34a44fce1506352a171232163e7716dd073ade000200000000000000000015': { name: 'rETH/Boosted 0vix USD', hasIcon: false, - boosted: false, + boosted: true, + boostedProtocols: [BoostedProtocol.Zerovix], }, }, Deep: [ @@ -105,6 +109,23 @@ const pools: Pools = { GaugeMigration: {}, BoostedApr: [], DisabledJoins: [], + Risks: { + '0x1d0a8a31cdb04efac3153237526fb15cc65a252000000000000000000000000f': [ + RiskKey.RateProviderBridge, + ], + '0xe1f2c039a68a216de6dd427be6c60decf405762a00000000000000000000000e': [ + RiskKey.RateProviderBridge, + ], + '0xdf725fde6e89981fb30d9bf999841ac2c160b512000000000000000000000010': [ + RiskKey.RateProviderBridge, + ], + '0x6f34a44fce1506352a171232163e7716dd073ade000200000000000000000015': [ + RiskKey.RateProviderBridge, + ], + '0x68a69c596b3839023c0e08d09682314f582314e5000200000000000000000011': [ + RiskKey.RateProviderBridge, + ], + }, }; export default pools; diff --git a/src/lib/scripts/voting-gauge.generator.ts b/src/lib/scripts/voting-gauge.generator.ts index 92cbfa248f..bd9bba9d88 100644 --- a/src/lib/scripts/voting-gauge.generator.ts +++ b/src/lib/scripts/voting-gauge.generator.ts @@ -153,16 +153,8 @@ function getTrustWalletAssetsURI( log( `getTrustWalletAssetsURI network: ${network} tokenAddress: ${tokenAddress}` ); - const networksMap = { - [Network.MAINNET]: 'ethereum', - [Network.ARBITRUM]: 'arbitrum', - [Network.POLYGON]: 'polygon', - [Network.GOERLI]: 'goerli', - [Network.OPTIMISM]: 'optimism', - [Network.GNOSIS]: 'xdai', - }; - - return `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${networksMap[network]}/assets/${tokenAddress}/logo.png`; + + return `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${config[network].trustWalletNetwork}/assets/${tokenAddress}/logo.png`; } async function isValidLogo(uri: string | undefined): Promise { @@ -197,12 +189,7 @@ async function getTokenLogoURI( logoUri = await getAssetURIFromTokenlists(tokenAddress, network); if (await isValidLogo(logoUri)) return logoUri; - if ( - network === Network.ARBITRUM || - network === Network.OPTIMISM || - network === Network.POLYGON || - network === Network.GNOSIS - ) { + if (network !== Network.MAINNET && config[network].testNetwork === false) { const mainnetAddress = await getMainnetTokenAddresss(tokenAddress, network); logoUri = getTrustWalletAssetsURI(mainnetAddress, Network.MAINNET); if (await isValidLogo(logoUri)) return logoUri; @@ -489,9 +476,29 @@ async function getGaugeInfo( } } +function checkNodeJSVersion() { + const nodeVersion = process.versions.node; + if (Number(nodeVersion.split('.')[0]) > 16) { + throw new Error( + `This script does not work with NodeJS > 16. You are using ${nodeVersion}. Please downgrade to continue.` + ); + } +} + +function checkRPCIsSet() { + if (!import.meta.env[`VITE_RPC_URL_1`]) { + throw new Error( + 'This script requires the env variable VITE_RPC_URL_1 to be set to your RPC URL, as the default Infura RPC will not work with CLI apps.' + ); + } +} + (async () => { console.log('Generating voting-gauges.json...'); + checkNodeJSVersion(); + checkRPCIsSet(); + console.log('Fetching gauges info...'); console.time('getGaugeInfo'); diff --git a/src/pages/risks.vue b/src/pages/risks.vue index e812baf97e..702493c1d3 100644 --- a/src/pages/risks.vue +++ b/src/pages/risks.vue @@ -1,3 +1,7 @@ + +