Skip to content

Commit 41c1c22

Browse files
authored
Prepare for allocator migration (#89)
* feat: prepare for allocator migration by allowing different allocator per chain id * chore: override base allocator on dev * fix: tweaks
1 parent ff8959c commit 41c1c22

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/utils/onchain-allocator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ const getPayloadBuilder = async (address: string) => {
8686
};
8787

8888
export const getOnchainAllocator = async (chainId: string) => {
89+
let allocator = config.onchainAllocator;
8990
if (
9091
process.env.SERVICE === "relay-protocol-hub-dev" &&
9192
["base"].includes(chainId)
9293
) {
93-
config.onchainAllocator = "0x45348c213bf7ddb8e45f34ca4f333307a78ecb9a";
94+
allocator = "0x45348c213bf7ddb8e45f34ca4f333307a78ecb9a";
9495
}
9596

96-
if (!config.onchainAllocator) {
97+
if (!allocator) {
9798
throw externalError("Onchain allocator not configured");
9899
}
99100

@@ -106,7 +107,7 @@ export const getOnchainAllocator = async (chainId: string) => {
106107
return {
107108
contract: getContract({
108109
client: walletClient,
109-
address: config.onchainAllocator as Address,
110+
address: allocator as Address,
110111
abi: parseAbi([
111112
`function submitWithdrawRequest(${PayloadParams} params) returns (bytes32)`,
112113
`function signWithdrawPayloadHash(${PayloadParams} params, bytes signature, ${GasSettings} gasSettings, uint32 index)`,

0 commit comments

Comments
 (0)