Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/import sdk abis #68

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions apps/frontend-v3/app/(app)/debug/pools/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
export default function DebugPools() {
return (
<FadeInOnView>
<HStack spacing="24px" align="start" width="80%" mx="auto">
<VStack padding="lg" margin="lg" align="start">
<HStack align="start" mx="auto" spacing="24px" width="80%">
<VStack align="start" margin="lg" padding="lg">
<Heading size="md">Debug V3 pools</Heading>
<Link as={NextLink} href="/pools/sepolia/v3/0xec1b5ca86c83c7a85392063399e7d2170d502e00">
<Link as={NextLink} href="/pools/sepolia/v3/0xd71958aed5e2e835a648ff832a181f7bdabbaf13">
Sepolia WEIGHTED (Balancer 50 BAL 50 WETH)
</Link>
<Link as={NextLink} href="/pools/sepolia/v3/0x8fc07bcf9b88ace84c7523248dc4a85f638c9536">
<Link as={NextLink} href="/pools/sepolia/v3/0x79f53b05828e09ec04f1a028a341cab09591523a">
Sepolia WEIGHTED with Proportional joins (Balancer 50 BAL 50 WETH -ExitFee Hook)
</Link>
<Link as={NextLink} href="/pools/sepolia/v3/0x7cf221fa36584f59a4f7fd7b946b8571c78e3692">
Sepolia STABLE (Balancer 50 BAL 50 WETH)
<Link as={NextLink} href="/pools/sepolia/v3/0x3ddd1e7adc6a3c1a6cbcf2dc74c6f71b9b347713">
Sepolia STABLE (USDT/USDC)
</Link>
</VStack>

<VStack padding="lg" margin="lg" align="start">
<VStack align="start" margin="lg" padding="lg">
<Heading size="md">Debug V2 pools</Heading>
<Link
as={NextLink}
Expand Down Expand Up @@ -103,7 +103,7 @@ export default function DebugPools() {
</Link>
</VStack>

<VStack padding="lg" margin="lg" align="start">
<VStack align="start" margin="lg" padding="lg">
<Heading size="md">Debug CoW AMM (V1) pools</Heading>
<Link as={NextLink} href="/pools/gnosis/cow/0x079d2094e16210c42457438195042898a3cff72d">
Gnosis CoW AMM
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@apollo/client": "^3.11.8",
"@balancer/sdk": "^0.27.0",
"@balancer/sdk": "^0.28.1",
"@chakra-ui/anatomy": "^2.2.2",
"@chakra-ui/hooks": "^2.2.1",
"@chakra-ui/icons": "^2.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/config/networks/sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const networkConfig: NetworkConfig = {
multicall2: '0xca11bde05977b3631167028862be2a173976ca11',
balancer: {
vaultV2: '0xBA12222222228d8Ba445958a75a0704d566BF2C8',
vaultV3: '0x0EF1c156a7986F394d90eD1bEeA6483Cc435F542',
router: '0xB12FcB422aAe6720f882E22C340964a7723f2387',
vaultV3: '0x30AF3689547354f82C70256894B07C9D0f067BB6',
router: '0x77eDc69766409C599F06Ef0B551a0990CBfe13A7',
relayerV6: '0x7852fB9d0895e6e8b3EedA553c03F6e2F9124dF9',
minter: '0x1783Cd84b3d01854A96B4eD5843753C2CcbD574A',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/debug-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const vaultV3Address = sepoliaNetworkConfig.contracts.balancer.vaultV3 as

export const poolId = '0x68e3266c9c8bbd44ad9dca5afbfe629022aee9fe000200000000000000000512' as const // Balancer Weighted wjAura and WETH

export const sepoliaRouter = '0xB12FcB422aAe6720f882E22C340964a7723f2387'
export const sepoliaRouter = '0x77eDc69766409C599F06Ef0B551a0990CBfe13A7'

/*
Used to pretty print objects when debugging
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/modules/pool/pool.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { PoolIssue } from './alerts/pool-issues/PoolIssue.type'
import { getUserTotalBalanceInt } from './user-balance.helpers'
import { dateToUnixTimestamp } from '@repo/lib/shared/utils/time'
import { balancerV2VaultAbi } from '../web3/contracts/abi/generated'
import { balancerV3VaultAbi } from '../web3/contracts/abi/balancerV3VaultAbi'
import { supportsNestedActions } from './actions/LiquidityActionHelpers'
import { getLeafTokens } from '../tokens/token.helpers'
import { GetTokenFn } from '../tokens/TokensProvider'
import { vaultV3Abi } from '@balancer/sdk'

/**
* METHODS
Expand Down Expand Up @@ -305,7 +305,7 @@ export function getVaultConfig(pool: Pool) {
networkConfig.contracts.balancer.vaultV3!
: networkConfig.contracts.balancer.vaultV2

const balancerVaultAbi = pool.protocolVersion === 3 ? balancerV3VaultAbi : balancerV2VaultAbi
const balancerVaultAbi = pool.protocolVersion === 3 ? vaultV3Abi : balancerV2VaultAbi

return { vaultAddress, balancerVaultAbi }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { cloneDeep } from 'lodash'
import { Address, formatUnits } from 'viem'
import { useReadContracts } from 'wagmi'
import { useTokens } from '../../tokens/TokensProvider'
import { balancerV3ExtensionVaultAbi } from '../../web3/contracts/abi/balancerV3ExtensionVaultAbi'
import { weightedPoolV3Abi } from '../../web3/contracts/abi/weightedPoolV3Abi'
import { Pool } from '../PoolProvider'
import { BPT_DECIMALS } from '../pool.constants'
import { GqlChain } from '@repo/lib/shared/services/api/generated/graphql'
Expand All @@ -16,6 +14,7 @@ import {
} from '../../web3/contracts/abi/generated'
import { isComposableStablePool } from '../pool.utils'
import { cowAmmPoolAbi } from '../../web3/contracts/abi/cowAmmAbi'
import { weightedPoolAbi_V3, vaultExtensionAbi_V3 } from '@balancer/sdk'

export function usePoolEnrichWithOnChainData(pool: Pool) {
const { priceFor } = useTokens()
Expand Down Expand Up @@ -53,14 +52,14 @@ function useV3PoolOnchainData(pool: Pool) {
contracts: [
{
chainId,
abi: balancerV3ExtensionVaultAbi,
abi: vaultExtensionAbi_V3,
address: vaultAddress,
functionName: 'getPoolTokenInfo',
args: [pool.address as Address],
},
{
chainId,
abi: weightedPoolV3Abi,
abi: weightedPoolAbi_V3,
address: pool.address as Address,
functionName: 'totalSupply',
args: [],
Expand Down
Loading
Loading