Skip to content

Commit 7097369

Browse files
authored
Merge pull request #800 from balancer/fix-monad-add-missing-addresses
Fix-monad-add-missing-addresses
2 parents 0453de1 + c8c2a65 commit 7097369

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

.changeset/shiny-dingos-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@balancer/sdk": patch
3+
---
4+
5+
fix-add-monad-addresses-and-update-tests

src/utils/balancerV3Contracts.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const balancerV3Contracts = {
6363
[ChainId.GNOSIS_CHAIN]: '0xcb3FE6cC529101AF5880a05429729f967501c9E7',
6464
[ChainId.HYPEREVM]: '0xFc00536A0fd292c284deeF6af8F644d8373d9cad',
6565
[ChainId.MAINNET]: '0x9B8168e330776feE6f857914FACA5FB831Dd2ab0',
66+
[ChainId.MONAD]: '0x268E2EE1413D768b6e2dc3F5a4ddc9Ae03d9AF42',
6667
[ChainId.PLASMA]: '0xF39CA6ede9BF7820a952b52f3c94af526bAB9015',
6768
[ChainId.SEPOLIA]: '0x8B8c22B8578A86ead5BcE7294ADFcba767329eb3',
6869
},
@@ -72,6 +73,7 @@ export const balancerV3Contracts = {
7273
[ChainId.GNOSIS_CHAIN]: '0x2FAa140F90f76eeEEBC191f4eF4b2634be1E4e91',
7374
[ChainId.HYPEREVM]: '0xd22eecBB495380Ef52b1CCeF1cA594979885D484',
7475
[ChainId.MAINNET]: '0xD5584b37D1845fFeD958C2d94bC675603DdCce68',
76+
[ChainId.MONAD]: '0xa3b370092aeb56770B23315252aB5E16DAcBF62B',
7577
[ChainId.PLASMA]: '0x3BEb058DE1A25dd24223fd9e1796df8589429AcE',
7678
[ChainId.SEPOLIA]: '0x7fed0fd2843232973eE2F61120e9D9C5eB78Cb16',
7779
},
@@ -81,6 +83,7 @@ export const balancerV3Contracts = {
8183
[ChainId.GNOSIS_CHAIN]: '0xD9E91f7aD501929b089992842a3f193795E6479e',
8284
[ChainId.HYPEREVM]: '0xAE563E3f8219521950555F5962419C8919758Ea2',
8385
[ChainId.MAINNET]: '0xeb1AA94421aEcFB1dc17dDB1068E4609c4bE8758',
86+
[ChainId.MONAD]: '0xe2fa4e1d17725e72dcdAfe943Ecf45dF4B9E285b',
8487
[ChainId.PLASMA]: '0xEAedc32a51c510d35ebC11088fD5fF2b47aACF2E',
8588
[ChainId.SEPOLIA]: '0x57Ef4cB125d1c690dF98118281090b7CdC7b9F85',
8689
},

test/anvil/anvil-global-setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type NetworksWithFork = Extract<
2828
| 'HYPEREVM'
2929
| 'PLASMA'
3030
| 'X_LAYER'
31+
| 'MONAD'
3132
>;
3233

3334
const ANVIL_PORTS: Record<NetworksWithFork, number> = {
@@ -46,6 +47,7 @@ const ANVIL_PORTS: Record<NetworksWithFork, number> = {
4647
HYPEREVM: 9745,
4748
PLASMA: 9845,
4849
X_LAYER: 9945,
50+
MONAD: 10045,
4951
};
5052

5153
export const ANVIL_NETWORKS: Record<NetworksWithFork, NetworkSetup> = {
@@ -134,6 +136,12 @@ export const ANVIL_NETWORKS: Record<NetworksWithFork, NetworkSetup> = {
134136
port: ANVIL_PORTS.X_LAYER,
135137
forkBlockNumber: 43138155n,
136138
},
139+
MONAD: {
140+
rpcEnv: 'MONAD_RPC_URL',
141+
fallBackRpc: 'https://rpc.monad.xyz',
142+
port: ANVIL_PORTS.MONAD,
143+
forkBlockNumber: 52794217n,
144+
},
137145
};
138146

139147
function getAnvilOptions(

test/lib/utils/addresses.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,18 @@ export const TOKENS: Record<number, Record<string, TestToken>> = {
242242
decimals: 18,
243243
},
244244
},
245+
[ChainId.MONAD]: {
246+
AUSD: {
247+
address: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
248+
decimals: 6,
249+
slot: 0, // not confirmed
250+
},
251+
WMON: {
252+
address: '0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A',
253+
decimals: 18,
254+
slot: 3,
255+
},
256+
},
245257
};
246258

247259
export type TestPool = TestToken & { id: Hex; type: PoolType };
@@ -436,4 +448,13 @@ export const POOLS: Record<number, Record<string, TestPool>> = {
436448
slot: 0,
437449
},
438450
},
451+
[ChainId.MONAD]: {
452+
MOCK_WMON_AUSD_POOL: {
453+
address: '0x770133233a092dd26934d15699d9f6c1538c74e6',
454+
id: '0x770133233a092dd26934d15699d9f6c1538c74e6',
455+
type: PoolType.Weighted,
456+
decimals: 18,
457+
slot: 0,
458+
},
459+
},
439460
};

test/validateAllNetworks.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const CHAIN_ANVIL_MAP: Partial<Record<number, keyof typeof ANVIL_NETWORKS>> = {
5252
[ChainId.HYPEREVM]: 'HYPEREVM',
5353
[ChainId.PLASMA]: 'PLASMA',
5454
[ChainId.X_LAYER]: 'X_LAYER',
55+
[ChainId.MONAD]: 'MONAD',
5556
// Add/remove mappings as needed for your test coverage
5657
};
5758

@@ -91,6 +92,12 @@ const NETWORK_CONFIG: Partial<
9192
poolKey: 'MOCK_USDT_xBTC_POOL',
9293
inputAmountRaw: 10000n,
9394
},
95+
[ChainId.MONAD]: {
96+
tokenInKey: 'WMON',
97+
tokenOutKey: 'AUSD',
98+
poolKey: 'MOCK_WMON_AUSD_POOL',
99+
inputAmountRaw: 1000000000000000n,
100+
},
94101
};
95102

96103
// Optionally override fork block numbers for specific chains. Useful to select pools deployed on V3 after
@@ -100,13 +107,15 @@ const BLOCK_NUMBER_OVERRIDES: Partial<Record<number, bigint>> = {
100107
[ChainId.MAINNET]: 22788192n,
101108
[ChainId.PLASMA]: 1274881n,
102109
[ChainId.X_LAYER]: 43173129n,
110+
[ChainId.MONAD]: 52794217n,
103111
};
104112

105113
// List of ChainIds to run the test for. Modify this array to select which chains to test.
106114
const CHAINS_TO_TEST: number[] = [
107115
ChainId.SEPOLIA,
108116
ChainId.HYPEREVM,
109117
ChainId.PLASMA,
118+
ChainId.MONAD,
110119
// ChainId.X_LAYER, // X_LAYER is not live and RPC is giving issues on CI (No Alchemy available)
111120
];
112121

0 commit comments

Comments
 (0)