Skip to content

Commit 535046e

Browse files
committed
use value only on native tokens
1 parent f74640d commit 535046e

File tree

1 file changed

+7
-2
lines changed
  • typescript/solver/solvers/hyperlane7683

1 file changed

+7
-2
lines changed

typescript/solver/solvers/hyperlane7683/filler.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AddressZero } from "@ethersproject/constants";
2-
import type { MultiProvider } from "@hyperlane-xyz/sdk";
2+
import { type MultiProvider } from "@hyperlane-xyz/sdk";
33
import {
44
addressToBytes32,
55
bytes32ToAddress,
@@ -199,14 +199,19 @@ async function fill(
199199
filler,
200200
);
201201

202+
const value =
203+
bytes32ToAddress(maxSpent[index].token) === AddressZero
204+
? maxSpent[index].amount
205+
: undefined;
206+
202207
// Depending on the implementation we may call `destination.fill` directly or call some other
203208
// contract that will produce the funds needed to execute this leg and then in turn call
204209
// `destination.fill`
205210
const tx = await destination.fill(
206211
orderId,
207212
originData,
208213
addressToBytes32(fillerAddress),
209-
{ value: maxSpent[index].amount },
214+
{ value },
210215
);
211216

212217
const receipt = await tx.wait();

0 commit comments

Comments
 (0)