Skip to content

Commit

Permalink
fix: call evmExecute with gas tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Feb 12, 2025
1 parent a46b56a commit 7a38a50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/localnet/src/evmExecute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ethers } from "ethers";
import { BigNumberish, ethers } from "ethers";

import { deployOpts } from "./deployOpts";
import { log } from "./log";
Expand All @@ -13,6 +13,7 @@ export const evmExecute = async ({
receiver,
message,
callOptions,
amount,
}: {
callOptions: any;
evmContracts: any;
Expand All @@ -23,6 +24,7 @@ export const evmExecute = async ({
sender: any;
tss: any;
zrc20: any;
amount: BigNumberish;

Check failure on line 27 in packages/localnet/src/evmExecute.ts

View workflow job for this annotation

GitHub Actions / lint

Expected interface keys to be in ascending order. 'amount' should be before 'zrc20'
}) => {
const chainID = foreignCoins.find(
(coin: any) => coin.zrc20_contract_address === zrc20
Expand All @@ -46,7 +48,10 @@ export const evmExecute = async ({
}
const executeTx = await evmContracts[chainID].gatewayEVM
.connect(tss)
.execute(messageContext, receiver, message, deployOpts);
.execute(messageContext, receiver, message, {
value: amount,
...deployOpts,
});

const logs = await provider.getLogs({
address: receiver,
Expand Down
1 change: 1 addition & 0 deletions packages/localnet/src/zetachainCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const zetachainCall = async ({
sender,
tss,
zrc20,
amount: 0,

Check failure on line 44 in packages/localnet/src/zetachainCall.ts

View workflow job for this annotation

GitHub Actions / lint

Expected object keys to be in ascending order. 'amount' should be before 'zrc20'
});
} catch (err: any) {
if (exitOnError) {
Expand Down
2 changes: 1 addition & 1 deletion packages/localnet/src/zetachainWithdrawAndCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const zetachainWithdrawAndCall = async ({
);
}
}

if (isGasToken) {
await evmExecute({
callOptions,
Expand All @@ -74,6 +73,7 @@ export const zetachainWithdrawAndCall = async ({
sender,
tss,
zrc20,
amount,

Check failure on line 76 in packages/localnet/src/zetachainWithdrawAndCall.ts

View workflow job for this annotation

GitHub Actions / lint

Expected object keys to be in ascending order. 'amount' should be before 'zrc20'
});
} else {
await evmCustodyWithdrawAndCall({
Expand Down

0 comments on commit 7a38a50

Please sign in to comment.