Skip to content

Commit 687be1b

Browse files
authored
fix: add multicall handler addresses (#249)
* add deploys, resolve with fallback Signed-off-by: Gerhard Steenkamp <[email protected]> * add eslint rule restricting absolute imports in sdk Signed-off-by: Gerhard Steenkamp <[email protected]> * refactor Signed-off-by: Gerhard Steenkamp <[email protected]> * add changeset Signed-off-by: Gerhard Steenkamp <[email protected]> --------- Signed-off-by: Gerhard Steenkamp <[email protected]>
1 parent aa9d8f1 commit 687be1b

File tree

4 files changed

+62
-10
lines changed

4 files changed

+62
-10
lines changed

.changeset/strong-queens-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@across-protocol/app-sdk": patch
3+
---
4+
5+
Adds multicall handler contract address definitions

packages/sdk/.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,18 @@
77
},
88
"env": {
99
"es2020": true
10+
},
11+
"rules": {
12+
"no-restricted-imports": [
13+
"error",
14+
{
15+
"patterns": [
16+
{
17+
"group": ["@/*"],
18+
"message": "Use relative imports instead of path aliases in library code to avoid compilation issues"
19+
}
20+
]
21+
}
22+
]
1023
}
1124
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Address } from "viem";
2+
3+
export const multicallHandlerDeployments: Record<number, Address> = {
4+
1: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
5+
10: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
6+
56: "0xAC537C12fE8f544D712d71ED4376a502EEa944d7",
7+
130: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
8+
137: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
9+
232: "0x1Ed0D59019a52870337b51DEe8190486a8663037",
10+
324: "0x68d3806E57148D6c6793C78EbDDbc272fE605dbf",
11+
480: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
12+
690: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
13+
919: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
14+
999: "0x5E7840E06fAcCb6d1c3b5F5E0d1d3d07F2829bba",
15+
1135: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
16+
1301: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
17+
1868: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
18+
4202: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
19+
8453: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
20+
9745: "0x5E7840E06fAcCb6d1c3b5F5E0d1d3d07F2829bba",
21+
34443: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
22+
37111: "0x02D2B95F631E0CF6c203E77f827381B0885F7822",
23+
42161: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
24+
57073: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
25+
59144: "0xdF1C940487574EEfa79989a79a4936A0F979cDa2",
26+
80002: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
27+
81457: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
28+
84532: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
29+
129399: "0xAC537C12fE8f544D712d71ED4376a502EEa944d7",
30+
421614: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
31+
534352: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
32+
808813: "0xAC537C12fE8f544D712d71ED4376a502EEa944d7",
33+
7777777: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
34+
11155111: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
35+
11155420: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
36+
168587773: "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E",
37+
// TODO: support SVM
38+
// 34268394551451: "HaQe51FWtnmaEcuYEfPA7MRCXKrtqptat4oJdJ8zV5Be",
39+
// 133268194659241: "Fk1RpqsfeWt8KnFCTW9NQVdVxYvxuqjGn6iPB9wrmM8h",
40+
};

packages/sdk/src/utils/multicallHandler.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
import { Address, encodeAbiParameters, parseAbiParameters } from "viem";
22

33
import { CrossChainAction } from "../types/index.js";
4+
import { multicallHandlerDeployments } from "../constants/multicall-handler.js";
45

56
export type BuildMessageParams = {
67
fallbackRecipient: Address;
78
actions: CrossChainAction[];
89
};
910

10-
export function getMultiCallHandlerAddress(chainId: number) {
11-
// @todo: use sdk or API to source addresses?
11+
export function getMultiCallHandlerAddress(chainId: number): Address {
1212
const defaultAddress = "0x924a9f036260DdD5808007E1AA95f08eD08aA569";
13-
switch (chainId) {
14-
case 324:
15-
return "0x863859ef502F0Ee9676626ED5B418037252eFeb2";
16-
case 59144:
17-
return "0x1015c58894961F4F7Dd7D68ba033e28Ed3ee1cDB";
18-
default:
19-
return defaultAddress;
20-
}
13+
const deployments = multicallHandlerDeployments;
14+
return deployments?.[chainId] ?? defaultAddress;
2115
}
2216

2317
export function buildMulticallHandlerMessage(params: BuildMessageParams) {

0 commit comments

Comments
 (0)