Skip to content

Commit

Permalink
Merge pull request #5620 from balancer/release/1.144.0
Browse files Browse the repository at this point in the history
Release 1.144.0
  • Loading branch information
garethfuller authored Apr 29, 2024
2 parents c0c7e4a + f483ca9 commit 99f11e0
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 92 deletions.
84 changes: 10 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer/frontend-v2",
"version": "1.143.62",
"version": "1.144.0",
"engines": {
"node": "=16",
"npm": ">=8"
Expand Down Expand Up @@ -116,7 +116,7 @@
"ethereumjs-util": "^7.0.7",
"events": "^3.3.0",
"feather-icons": "^4.28.0",
"happy-dom": "^13.1.4",
"happy-dom": "14.7.1",
"husky": "^8.0.0",
"jest-extended": "^3.2.4",
"json-to-graphql-query": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/cards/CreatePool/ChooseWeights.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useTokens } from '@/providers/tokens.provider';
import { bnum } from '@/lib/utils';
import { configService } from '@/services/config/config.service';
import useWeb3 from '@/services/web3/useWeb3';
import { isGoerli } from '@/composables/useNetwork';
import { isTestnet } from '@/composables/useNetwork';
const emit = defineEmits(['update:height', 'trigger:alert']);
Expand Down Expand Up @@ -103,7 +103,7 @@ const isProceedDisabled = computed(() => {
if (Number(totalAllocatedWeight.value) !== 100) return true;
if (seedTokens.value.length < 2) return true;
if (zeroWeightToken.value) return true;
if (hasUnlistedToken.value && !isGoerli.value) return true;
if (hasUnlistedToken.value && !isTestnet.value) return true;
return false;
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/contextual/pages/pool/PoolActionsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
usePoolHelpers,
deprecatedDetails,
} from '@/composables/usePoolHelpers';
import useNetwork, { isGoerli } from '@/composables/useNetwork';
import useNetwork, { isTestnet } from '@/composables/useNetwork';
import { Pool } from '@/services/pool/types';
import useWeb3 from '@/services/web3/useWeb3';
Expand Down Expand Up @@ -63,7 +63,7 @@ const _hasNonApprovedRateProviders = computed(() => {
});
const joinDisabled = computed((): boolean => {
if (isGoerli.value) return false;
if (isTestnet.value) return false;
return (
!!deprecatedDetails(props.pool.id) ||
Expand Down
9 changes: 7 additions & 2 deletions src/components/pool/branded-redirect/BrandedRedirectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { POOLS } from '@/constants/pools';
import { PoolType } from '@/services/pool/types';
const props = defineProps<{
poolId: string;
poolType: PoolType | undefined;
}>();
Expand All @@ -23,6 +24,10 @@ const bannerSrc = computed<string>(() => {
if (hasBannerImage.value) return redirectData.value.buildBannerPath();
return '';
});
const brandLink = computed<string>(() => {
return redirectData.value?.link(props.poolId, props.poolType) || '';
});
</script>

<template>
Expand All @@ -38,11 +43,11 @@ const bannerSrc = computed<string>(() => {
{{ $t(redirectData.description) }}
</div>
<BalBtn
v-if="redirectData.link"
v-if="brandLink"
color="blue"
block
tag="a"
:href="redirectData.link"
:href="brandLink"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
35 changes: 32 additions & 3 deletions src/components/pool/branded-redirect/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { networkId } from '@/composables/useNetwork';
import { addressFor } from '@/composables/usePoolHelpers';
import { PoolType } from '@balancer-labs/sdk';

interface BrandedRedirectData {
id: string;
title: string;
description: string;
btnText: string;
link: string;
link: (poolId: string, poolType: PoolType | undefined) => string;
buildBannerPath?: () => string;
}

Expand All @@ -13,18 +18,42 @@ export const BRANDED_REDIRECT_DATA: Record<string, BrandedRedirectData> = {
title: 'brandedRedirect.xave.title',
description: 'brandedRedirect.xave.description',
btnText: 'brandedRedirect.xave.btnText',
link: 'https://app.xave.co/',
link: (poolId: string, poolType: PoolType | undefined) =>
'https://app.xave.co/',
buildBannerPath: buildXaveBannerPath,
},
gyro: {
id: 'gyro',
title: 'brandedRedirect.gyro.title',
description: 'brandedRedirect.gyro.description',
btnText: 'brandedRedirect.gyro.btnText',
link: 'https://app.gyro.finance/',
link: (poolId: string, poolType: PoolType | undefined) => {
const poolAddress = addressFor(poolId);
const networkSlug = gyroNetworkSlugMap[networkId.value];
console.log('poolType', poolType);
const poolTypeSlug = gyroPoolTypeMap[poolType || ''];

if (!networkSlug || !poolTypeSlug) return 'https://app.gyro.finance';
return `https://app.gyro.finance/pools/${networkSlug}/${poolTypeSlug}/${poolAddress}`;
},
},
};

const gyroPoolTypeMap: Record<string, string> = {
[PoolType.Gyro2]: '2-clp',
[PoolType.Gyro3]: '3-clp',
[PoolType.GyroE]: 'e-clp',
};

const gyroNetworkSlugMap: Record<number, string> = {
1: 'ethereum',
10: 'optimism',
137: 'polygon',
8453: 'base',
1101: 'polygonZKEVM',
42161: 'arbitrum',
};

export function buildXaveBannerPath(): string {
return new URL(
// https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async function mountTransferGuards(pool: Pool) {
describe('When checking disabled pool joins', () => {
it('does not redirect where no disabled joins', async () => {
const veBalPool = aVeBalPool();
veBalPool.priceRateProviders = [];

await mountTransferGuards(veBalPool);

Expand Down
4 changes: 2 additions & 2 deletions src/composables/pools/usePoolCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import useWeb3 from '@/services/web3/useWeb3';
import { useTokens } from '@/providers/tokens.provider';
import { PoolType } from '@balancer-labs/sdk';
import { wNativeAssetAddress } from '../usePoolHelpers';
import { isGoerli } from '../useNetwork';
import { isTestnet } from '../useNetwork';

export const POOL_CREATION_STATE_VERSION = '1.0';
export const POOL_CREATION_STATE_KEY = 'poolCreationState';
Expand Down Expand Up @@ -424,7 +424,7 @@ export default function usePoolCreation() {
}

async function createPool(): Promise<TransactionResponse> {
if (hasUnlistedToken.value && !isGoerli.value) {
if (hasUnlistedToken.value && !isTestnet.value) {
throw new Error('Invalid pool creation due to unlisted tokens.');
}
const provider = getProvider();
Expand Down
14 changes: 14 additions & 0 deletions src/composables/useDisabledJoinPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isStableLike,
isWeighted,
noInitLiquidity,
usePoolHelpers,
} from '@/composables/usePoolHelpers';
import { computed } from 'vue';

Expand Down Expand Up @@ -37,6 +38,7 @@ function doesRequireAllowListing(pool: Pool, account: string): boolean {
export function useDisabledJoinPool(pool: Pool) {
const { account } = useWeb3();
const { balancerTokenList } = useTokenLists();
const { hasNonApprovedRateProviders } = usePoolHelpers(toRef(pool));

const notVettedTokens = computed(() => {
const vettedTokenAddresses = balancerTokenList.value.tokens.map(
Expand Down Expand Up @@ -76,13 +78,25 @@ export function useDisabledJoinPool(pool: Pool) {
return doesRequireAllowListing(pool, account.value);
});

const unapprovedRateProvider = computed(() => {
const nonApprovedRateProviderExceptions = [
// wjAURA-WETH - https://github.com/balancer/frontend-v2/issues/4417
'0x68e3266c9c8bbd44ad9dca5afbfe629022aee9fe000200000000000000000512',
];
return (
hasNonApprovedRateProviders.value &&
!nonApprovedRateProviderExceptions.includes(pool.id)
);
});

const disableJoinsReason = computed(() => ({
notInitialLiquidity: notInitialLiquidity.value,
requiresAllowListing: requiresAllowListing.value,
nonVettedTokensAfterTimestamp: nonVettedTokensAfterTimestamp.value,
nonAllowedWeightedPoolAfterTimestamp:
nonAllowedWeightedPoolAfterTimestamp.value,
hardcoded: isJoinsDisabled(pool.id),
unapprovedRateProvider: unapprovedRateProvider.value,
}));

const shouldDisableJoins = computed(() => {
Expand Down
11 changes: 9 additions & 2 deletions src/lib/config/arbitrum/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const pools: Pools = {
'0x59743f1812bb85db83e9e4ee061d124aaa64290000000000000000000000052b', // sUSDe/sFRAX
'0x2f0cdf8596be980ef24924ca7bf54e630ca526b2000000000000000000000529', // sUSDe/USDC
'0x537d8ef9e6e0adfb099cb14aeaf04ebeffaf444c000000000000000000000528', // USDe/USDC
'0xfb2f7ed572589940e24c5711c002adc59d5e79ef000000000000000000000535', // jitoSOL/wSOL
],
},
Investment: {
Expand Down Expand Up @@ -203,6 +204,11 @@ const pools: Pools = {
'0x64abeae398961c10cbb50ef359f1db41fc3129ff000200000000000000000526', // 80AURA-20WETH
'0xb09dc8f98164974fa89e55a97fd99b62bdbe4de200020000000000000000052c', // 50T/50wETH
'0xe26a52ca1f508ff026f366ab6505bb95332a51d600020000000000000000052d', // 50WETH-50USDC
'0x026a586b3fe3b3d07375b4a11a505c8b4ef07eec000200000000000000000533', // 50weETH-50WETH
'0x3b106b7ae88c3f8869b5221d2bbae398afc26737000100000000000000000534', // 33WETH-33USDC-33USDT
'0x260dbd54d87a10a0fc9d08622ebc969a3bf4e6bb000200000000000000000536', // jitoSOL/wstETH
'0xf2658f994c882237d3612099cae541d50348fcf9000200000000000000000537', // PUPPET-WETH
'0xbc450dcb3a135a57448f8054badaec5c9f2af571000200000000000000000538', // 50SOL-50wstETH
],
},
Factories: {
Expand All @@ -222,7 +228,8 @@ const pools: Pools = {
'0xc7e5ed1054a24ef31d827e6f86caa58b3bc168d7': 'weightedPool', // weighted pool v4
'0x2498a2b0d6462d2260eac50ae1c3e03f4829ba95': 'composableStablePool', // ComposableStable V4
'0xa8920455934da4d853faac1f94fe7bef72943ef1': 'composableStablePool', // ComposableStable V5
'0xdca5f1f0d7994a32bc511e7dba0259946653eaf6': 'gyroE',
'0xdca5f1f0d7994a32bc511e7dba0259946653eaf6': 'gyroE', // Gyro ECLP
'0x7a36527a02d96693b0af2b70421f952816a4a088': 'gyroE', // Gyro ECLP
},
Stakable: {
VotingGaugePools: [
Expand Down Expand Up @@ -322,7 +329,7 @@ const pools: Pools = {
points: [
{
protocol: Protocol.Renzo,
multiple: '2',
multiple: '3',
description:
'LPs in this pool earn 2x ezPoints on the TVL of the pool (wstETH + ezETH)',
},
Expand Down
Loading

0 comments on commit 99f11e0

Please sign in to comment.