Skip to content

Commit

Permalink
Merge pull request #3638 from balancer/feat/sepolia
Browse files Browse the repository at this point in the history
Feat - Sepolia Support
  • Loading branch information
timjrobinson authored Jul 25, 2023
2 parents 044b6c5 + edd97f4 commit a950870
Show file tree
Hide file tree
Showing 26 changed files with 399 additions and 25 deletions.
70 changes: 70 additions & 0 deletions src/assets/data/contracts/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"AaveLinearPoolFactory": "0xDF9B5B00Ef9bca66e9902Bd813dB14e4343Be025",
"Authorizer": "0xA331D84eC860Bf466b4CdCcFb4aC09a1B43F3aE6",
"AuthorizerAdaptor": "0xdcdbf71A870cc60C6F9B621E28a7D3Ffd6Dd4965",
"AuthorizerAdaptorEntrypoint": "0xb9aD3466cdd42015cc05d4804DC68D562b6a2065",
"AuthorizerWithAdaptorValidation": "0xb521dD5C8e13fE202626CaC98873FEA2b7760cE4",
"BalancerHelpers": "0xdAE7e32ADc5d490a43cCba1f0c736033F2b4eFca",
"BalancerMinter": "0x1783Cd84b3d01854A96B4eD5843753C2CcbD574A",
"BalancerQueries": "0x1802953277FD955f9a254B80Aa0582f193cF1d77",
"BalancerRelayer": "0x6d5342d716c13d9a3F072a2B11498624ADe27f90",
"BalancerTokenAdmin": "0x7d2248F194755DCa9A1887099394F39476d28C9a",
"BALTokenHolderFactory": "0xEF454a7B3f965D3f6723E462405246f8Cd865425",
"BatchRelayerLibrary": "0x5F6848976C2914403B425F18B589A65772F082E3",
"ChildChainGauge": "0xC49Ca921c4CD1117162eAEEc0ee969649997950c",
"ChildChainGaugeFactory": "0xC370cD86d5488c1788b62f11b09adb0C47F47440",
"CircuitBreakerLib": "0x4C0C450bEdB9282A7a54fCB316c285E85A8c0265",
"ComposableStablePoolFactory": "0xA3fd20E29358c056B727657E83DFd139abBC9924",
"ERC4626LinearPoolFactory": "0x59562f93c447656F6E4799fC1FC7c3d977C3324F",
"ExternalWeightedMath": "0x8246e571d88ACd1346179Cc3641DE87Fe3544d7A",
"FeeDistributor": "0xA6971317Fb06c76Ef731601C64433a4846fCa707",
"GaugeAdder": "0x1DF32616fb1bBaEd07f42F1a1EfD1D0E232AcB4a",
"GaugeController": "0x577e5993B9Cc480F07F98B5Ebd055604bd9071C4",
"GearboxLinearPoolFactory": "0x8df317a729fcaA260306d7de28888932cb579b88",
"L2BalancerPseudoMinter": "0xb51f7fFc97CeDFb6922e8B9Bbf3eF7575fafD630",
"L2LayerZeroBridgeForwarder": "0xc7E5ED1054A24Ef31D827E6F86caA58B3Bc168d7",
"LiquidityGaugeFactory": "0x2FF226CD12C80511a641A6101F071d853A4e5363",
"LiquidityGaugeV5": "0x82416Ce6eA7dD4923d4A3ED70a79B4A432a382C4",
"ManagedPoolAddRemoveTokenLib": "0xc7416E4f3715467dDcf28dc409A9483b2E4D4F43",
"ManagedPoolAmmLib": "0xa30aDE89E6af5b0Ca515cd78e44f9aD0c63989b2",
"ManagedPoolFactory": "0x63e179C5b6d54B2c2e36b9cE4085EF5A8C86D50c",
"MockAaveLendingPool": "0x300Ab2038EAc391f26D9F895dc61F8F66a548833",
"MockAaveLinearPool": "0xE4EfD99f3C03778ba913Eb578C599329634e2bd7",
"MockComposableStablePool": "0xA8D865FE1D68a405B29f884358468c9B52d4841d",
"MockERC4626LinearPool": "0x0c2EAd6F2Dc2A9385187023F4cec5925337B330f",
"MockERC4626Token": "0x2498A2B0d6462d2260EAC50aE1C3e03F4829BA95",
"MockGearboxDieselToken": "0x4C32a8a8fDa4E24139B51b456B42290f51d6A1c4",
"MockGearboxLinearPool": "0x112a7b7ca66E6963C49BC523A415F7D8CDB806B9",
"MockGearboxVault": "0x3B1eb8EB7b43882b385aB30533D9A2BeF9052a98",
"MockLiquidityBootstrappingPool": "0xe90472ffc41D7Ddf8E3B456bBA748e3F22c59C6f",
"MockManagedPool": "0xE458224CA8d6605c87b73E92aa5CB7A4e77770f3",
"MockShareToken": "0x0c6052254551EAe3ECac77B01DFcf1025418828f",
"MockSilo": "0x6B1Da720Be2D11d95177ccFc40A917c2688f396c",
"MockSiloLinearPool": "0xA149CF2D795AaB83a15673f5Beade9361e4e3F65",
"MockSiloRepository": "0xa7d524046ef89de9F8e4f2d7B029f66cCB738d48",
"MockStaticAToken": "0x03F3Fb107e74F2EAC9358862E91ad3c692712054",
"MockWeightedPool": "0xf7a7E1F48FA43cb7919Ff4Eb362c5bE78092dF4A",
"MockYearnLinearPool": "0x016B7366F76aa2794097798B90CF239796AEff8d",
"MockYearnTokenVault": "0x9129E834e15eA19b6069e8f08a8EcFc13686B8dC",
"NoProtocolFeeLiquidityBootstrappingPoolFactory": "0x45fFd460cC6642B8D8Fb12373DFd77Ceb0f4932B",
"NullVotingEscrow": "0x475D18169BE8a89357A9ee3Ab00ca386d20fA229",
"PoolRecoveryHelper": "0x1b6F057520B4e826271D47b8bdab98E35Af17E59",
"PreseededVotingEscrowDelegation": "0xb1a4FE1C6d25a0DDAb47431A92A723dd71d9021f",
"ProtocolFeePercentagesProvider": "0xf7D5DcE55E6D47852F054697BAB6A1B48A00ddbd",
"ProtocolFeesCollector": "0xce88686553686DA562CE7Cea497CE749DA109f9F",
"ProtocolFeesWithdrawer": "0x809B79b53F18E9bc08A961ED4678B901aC93213a",
"ProtocolIdRegistry": "0x6CaD2ea22BFA7F4C14Aae92E47F510Cd5C509bc7",
"RecoveryModeHelper": "0x5419e785b83Ad3539D3a8741C0ABb77D90d8784E",
"SiloLinearPoolFactory": "0x8eA89804145c007e7D226001A96955ad53836087",
"SingleRecipientGauge": "0x9a5ddDE7056ceFFb03D9962c4549Ac1C4ad1F985",
"SingleRecipientGaugeFactory": "0x7EE4D172Ae50C627a1BFA9A99E1260C54dA26fdF",
"SmartWalletChecker": "0x230a59F4d9ADc147480f03B0D3fFfeCd56c3289a",
"TestBalancerToken": "0xb19382073c7A0aDdbb56Ac6AF1808Fa49e377B75",
"Vault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"VeBoostV2": "0x927906bbAc747c13c75F6447FE8abb490EAB456C",
"VotingEscrow": "0x150A72e4D4d81BbF045565E232c50Ed0931ad795",
"VotingEscrowDelegation": "0x0c5538098EBe88175078972F514C9e101D325D4F",
"VotingEscrowDelegationProxy": "0xD87F44Df0159DC78029AB9CA7D7e57E7249F5ACD",
"WeightedPoolFactory": "0x7920BFa1b2041911b354747CA7A6cDD2dfC50Cfd",
"YearnLinearPoolFactory": "0xAcf05BE5134d64d150d153818F8C67EE36996650"
}
15 changes: 15 additions & 0 deletions src/assets/images/icons/networks/sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/navs/AppNav/DesktopLinks/DesktopLinks.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { useRoute } from 'vue-router';
import DesktopLinkItem from './DesktopLinkItem.vue';
import useNetwork, { isGoerli } from '@/composables/useNetwork';
import useNetwork, { isTestnet } from '@/composables/useNetwork';
import { Goals, trackGoal } from '@/composables/useFathom';
/**
Expand Down Expand Up @@ -48,7 +48,7 @@ function isActive(page: string): boolean {
</div>
</DesktopLinkItem>
<DesktopLinkItem
v-if="isGoerli"
v-if="isTestnet"
:to="{ name: 'faucet', params: { networkSlug } }"
:active="isActive('faucet')"
>
Expand Down
21 changes: 20 additions & 1 deletion src/composables/useDisabledJoinPool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ it('disables joins for pools created after timestamp (2023-03-29) with non vette
);
});

it('disables joins for weigthed pools created after timestamp (2023-03-29) that are not in the weighted allow list', async () => {
it('disables joins for weighted pools created after timestamp (2023-03-29) that are not in the weighted allow list', async () => {
const { networkId } = useNetwork();
networkId.value = 1;

const pool = BoostedPoolMock;
pool.createTime = dateToUnixTimestamp('2023-03-30'); //Created after 29 March
pool.poolType = PoolType.Weighted;
Expand All @@ -60,6 +63,22 @@ it('disables joins for weigthed pools created after timestamp (2023-03-29) that
).toBeTrue();
});

it('allows joins for weighted pools on test networks created after timestamp (2023-03-29) that are not in the weighted allow list', async () => {
const { networkId } = useNetwork();
networkId.value = 5;

const pool = BoostedPoolMock;
pool.createTime = dateToUnixTimestamp('2023-03-30'); //Created after 29 March
pool.poolType = PoolType.Weighted;
const { disableJoinsReason } = await mountVettedTokensInPool(pool);

pool.tokens[0].address = randomAddress();

expect(
disableJoinsReason.value.nonAllowedWeightedPoolAfterTimestamp
).toBeFalse();
});

it('does not disables joins for pools created before 29 march', async () => {
const pool = BoostedPoolMock;
pool.createTime = dateToUnixTimestamp('2023-03-28'); //Created before 29 March
Expand Down
1 change: 1 addition & 0 deletions src/composables/useDisabledJoinPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function useDisabledJoinPool(pool: Pool) {

const nonAllowedWeightedPoolAfterTimestamp = computed(() => {
return (
!isTestnet.value &&
isWeighted(pool.poolType) &&
createdAfterTimestamp(pool) &&
!POOLS.Weighted.AllowList.includes(pool.id)
Expand Down
8 changes: 6 additions & 2 deletions src/composables/useNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ export const isArbitrum = computed(() => networkId.value === Network.ARBITRUM);
export const isGnosis = computed(() => networkId.value === Network.GNOSIS);
export const isGoerli = computed(() => networkId.value === Network.GOERLI);

export const hasBridge = computed<boolean>(() => !!networkConfig.bridgeUrl);
export const isTestnet = computed(() => isGoerli.value);
export const hasBridge = computed<boolean>(
() => !!config[networkId.value].bridgeUrl
);
export const isTestnet = computed<boolean>(
() => !!config[networkId.value].testNetwork
);

export const isEIP1559SupportedNetwork = computed(
() => configService.network.supportsEIP1559
Expand Down
8 changes: 4 additions & 4 deletions src/composables/useVotingGauges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Duration, Interval, intervalToDuration, nextThursday } from 'date-fns';
import { computed, onUnmounted, ref } from 'vue';

import {
GOERLI_VOTING_GAUGES,
MAINNET_VOTING_GAUGES,
VotingGauge,
votingGaugesForNetwork,
} from '@/constants/voting-gauges';

import useGaugeVotesQuery from './queries/useGaugeVotesQuery';
import { isGoerli } from './useNetwork';
import { networkId, isTestnet } from './useNetwork';
import { orderedPoolTokens } from '@/composables/usePoolHelpers';
import { VotingGaugeWithVotes } from '@/services/balancer/gauges/gauge-controller.decorator';
import { Pool, PoolToken } from '@/services/pool/types';
Expand All @@ -34,8 +34,8 @@ export default function useVotingGauges() {

// Hard coded list of voting gauges
const _votingGauges = computed((): VotingGauge[] => {
if (isGoerli.value) {
return GOERLI_VOTING_GAUGES as VotingGauge[];
if (isTestnet.value) {
return votingGaugesForNetwork(networkId.value);
}
return MAINNET_VOTING_GAUGES as VotingGauge[];
});
Expand Down
7 changes: 7 additions & 0 deletions src/constants/voting-gauges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export type VotingGauge = {
tokenLogoURIs: Record<string, string | undefined>;
};

export function votingGaugesForNetwork(network: Network) {
const filteredGauges: VotingGauge[] = (
ALL_VOTING_GAUGES as VotingGauge[]
).filter(gauge => gauge.network === network);
return filteredGauges;
}

export const GOERLI_VOTING_GAUGES: VotingGauge[] = (
ALL_VOTING_GAUGES as VotingGauge[]
).filter(gauge => gauge.network === Network.GOERLI);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config/arbitrum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const config: Config = {
key: '42161',
chainId: 42161,
layerZeroChainId: 110,
supportsVeBalSync: true,
chainName: 'Arbitrum',
name: 'Arbitrum',
shortName: 'Arbitrum',
Expand Down Expand Up @@ -43,6 +42,7 @@ const config: Config = {
bridgeUrl: 'https://bridge.arbitrum.io/',
supportsEIP1559: false,
supportsElementPools: false,
supportsVeBalSync: true,
blockTime: 2,
nativeAsset: {
name: 'Ether',
Expand Down
5 changes: 1 addition & 4 deletions src/lib/config/gnosis-chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ const config: Config = {
},
pools,
tokens,
keys: {
infura: 'daaa68ec242643719749dd1caba2fc66',
alchemy: 'oGLgncMVHNWltnK0nTfiryxQ6gYemKQO',
},
keys: {},
gauges: {
type: 2,
weight: 100,
Expand Down
1 change: 0 additions & 1 deletion src/lib/config/goerli/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Keys } from '../types';

const keys: Keys = {
infura: 'daaa68ec242643719749dd1caba2fc66',
alchemy: 'oGLgncMVHNWltnK0nTfiryxQ6gYemKQO',
};

export default keys;
11 changes: 11 additions & 0 deletions src/lib/config/goerli/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,37 @@ const tokens: TokenConstants = {
* Addresses must be lower case and map from goerli to mainnet, e.g
* [goerli address]: mainnet address
*/
// WETH
'0xdfcea9088c8a88a76ff74892c1457c17dfeef9c1':
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
// WBTC
'0x37f03a12241e9fd3658ad6777d289c3fb8512bc9':
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
// BAL
'0xfa8449189744799ad2ace7e0ebac8bb7575eff47':
'0xba100000625a3754423978a60c9317c58a424e3d',
// USDC
'0xe0c9275e44ea80ef17579d33c55136b7da269aeb':
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
// DAI
'0x8c9e6c40d3402480ace624730524facc5482798c':
'0x6b175474e89094c44da98b954eedeac495271d0f',
// USDT
'0x1f1f156e0317167c11aa412e3d1435ea29dc3cce':
'0xdac17f958d2ee523a2206206994597c13d831ec7',
// aUSDT
'0x4cb1892fddf14f772b2e39e299f44b2e5da90d04':
'0x3ed3b47dd13ec9a98b44e6204a523e766b225811',
// aUSDC
'0x811151066392fd641fe74a9b55a712670572d161':
'0xbcca60bb61934080951369a648fb03df4f96263c',
// aDAI
'0x89534a24450081aa267c79b07411e9617d984052':
'0x028171bca77440897b824ca71d1c56cac55b68a3',
// FEI
'0x829f35cebbcd47d3c120793c12f7a232c903138b':
'0x956f47f50a910163d8bf957cf5846d573e7f87ca',
// GNO
'0xff386a3d08f80ac38c77930d173fa56c6286dc8b':
'0x6810e776880c02933d47db1b9fc05908e5386b96',
},
Expand Down
3 changes: 3 additions & 0 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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';

// We don't import Network from sdk to avoid extra bundle size when loading app (while the SDK is not tree-shakable)
Expand All @@ -21,6 +22,7 @@ export enum Network {
ZKEVM = 1101,
ARBITRUM = 42161,
AVALANCHE = 43114,
SEPOLIA = 11155111,
}

const config: Record<Network | number, Config> = {
Expand All @@ -32,6 +34,7 @@ const config: Record<Network | number, Config> = {
[Network.GNOSIS]: gnosisChain,
[Network.ZKEVM]: zkevm,
[Network.AVALANCHE]: avalanche,
[Network.SEPOLIA]: sepolia,
};

export default config;
2 changes: 1 addition & 1 deletion src/lib/config/optimism/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const config: Config = {
key: '10',
chainId: 10,
layerZeroChainId: 111,
supportsVeBalSync: true,
chainName: 'Optimism',
name: 'Optimism Mainnet',
shortName: 'Optimism',
Expand Down Expand Up @@ -39,6 +38,7 @@ const config: Config = {
bridgeUrl: '',
supportsEIP1559: false,
supportsElementPools: false,
supportsVeBalSync: true,
nativeAsset: {
name: 'Ether',
address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config/polygon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const config: Config = {
key: '137',
chainId: 137,
layerZeroChainId: 109,
supportsVeBalSync: true,
chainName: 'Polygon PoS',
name: 'Polygon Mainnet',
shortName: 'Polygon',
Expand Down Expand Up @@ -42,6 +41,7 @@ const config: Config = {
bridgeUrl: 'https://wallet.polygon.technology/polygon/bridge',
supportsEIP1559: true,
supportsElementPools: false,
supportsVeBalSync: true,
blockTime: 4,
nativeAsset: {
name: 'Matic',
Expand Down
28 changes: 28 additions & 0 deletions src/lib/config/sepolia/contracts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Contracts } from '../types';
import * as sepolia from '@/assets/data/contracts/sepolia.json';

const contracts: Contracts = {
merkleRedeem: '',
merkleOrchard: '',
multicall: '0xca11bde05977b3631167028862be2a173976ca11',
authorizer: sepolia.Authorizer,
vault: sepolia.Vault,
weightedPoolFactory: sepolia.WeightedPoolFactory,
stablePoolFactory: sepolia.ComposableStablePoolFactory,
lidoRelayer: '',
balancerHelpers: sepolia.BalancerHelpers,
batchRelayer: sepolia.BalancerRelayer,
gaugeFactory: '',
balancerMinter: sepolia.BalancerMinter,
gaugeController: sepolia.GaugeController,
tokenAdmin: sepolia.BalancerTokenAdmin,
veBAL: sepolia.VotingEscrow,
veDelegationProxy: '',
veBALHelpers: '',
feeDistributor: '',
feeDistributorDeprecated: '',
faucet: '',
gaugeRewardsHelper: '',
};

export default contracts;
Loading

1 comment on commit a950870

@vercel
Copy link

@vercel vercel bot commented on a950870 Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.