Skip to content

Commit

Permalink
Merge pull request #363 from balancer/fix-undefined-chain
Browse files Browse the repository at this point in the history
Fix undefined chain
  • Loading branch information
johngrantuk committed Jul 19, 2024
2 parents 1241354 + 39db20c commit 6f57704
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-dolphins-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@balancer/sdk": patch
---

Add missing config for Avalanche and ZkEvm.
16 changes: 16 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ export const NATIVE_ASSETS = {
'Ether',
'0x7b79995e5f793a07bc00c21412e50ecae098e7f9',
),
[ChainId.AVALANCHE]: new Token(
ChainId.AVALANCHE,
NATIVE_ADDRESS,
18,
'AVAX',
'Avax',
'0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7',
),
[ChainId.ZKEVM]: new Token(
ChainId.ZKEVM,
NATIVE_ADDRESS,
18,
'MATIC',
'Matic',
'0xa2036f0538221a77a3937f1379699f44945018d0',
),
};

export const ETH = NATIVE_ASSETS[ChainId.MAINNET];
Expand Down
8 changes: 8 additions & 0 deletions test/anvil/anvil-global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type NetworksWithFork = Extract<
| 'OPTIMISM'
| 'MODE'
| 'FRAXTAL'
| 'AVALANCHE'
>;

const ANVIL_PORTS: Record<NetworksWithFork, number> = {
Expand All @@ -32,6 +33,7 @@ const ANVIL_PORTS: Record<NetworksWithFork, number> = {
OPTIMISM: 9045,
MODE: 9145,
FRAXTAL: 9245,
AVALANCHE: 9345,
};

export const ANVIL_NETWORKS: Record<NetworksWithFork, NetworkSetup> = {
Expand Down Expand Up @@ -80,6 +82,12 @@ export const ANVIL_NETWORKS: Record<NetworksWithFork, NetworkSetup> = {
port: ANVIL_PORTS.FRAXTAL,
forkBlockNumber: 7164945n,
},
AVALANCHE: {
rpcEnv: 'AVALANCHE_RPC_URL',
fallBackRpc: 'https://avalanche.gateway.tenderly.co/',
port: ANVIL_PORTS.AVALANCHE,
forkBlockNumber: 48164407n,
},
};

function getAnvilOptions(
Expand Down
12 changes: 12 additions & 0 deletions test/lib/utils/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ export const TOKENS: Record<number, Record<string, TestToken>> = {
slot: 0,
},
},
[ChainId.AVALANCHE]: {
sAVAX: {
address: '0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be',
decimals: 18,
slot: 0,
},
WAAVAX: {
address: '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7',
decimals: 18,
slot: 0,
},
},
};

export type TestPool = TestToken & { id: Hex; type: PoolType };
Expand Down

0 comments on commit 6f57704

Please sign in to comment.