Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jan 29, 2024
1 parent 145f501 commit 0ca1110
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
15 changes: 8 additions & 7 deletions helpers/sendZRC20.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import ERC20_ABI from "@openzeppelin/contracts/build/contracts/ERC20.json";
import { networks } from "@zetachain/networks";
import { getChainId } from "@zetachain/networks";
import { getAddress } from "@zetachain/protocol-contracts";
import ZRC20 from "@zetachain/protocol-contracts/abi/zevm/ZRC20.sol/ZRC20.json";
import { ethers } from "ethers";

import { getForeignCoins } from "../helpers/balances";
import { getChainId } from "@zetachain/networks";

export const withdraw = async ({
signer,
amount,
to,
zrc20,
}: {
signer: any;
amount: string;
signer: any;
to: any;
zrc20: string;
}) => {
Expand All @@ -35,11 +36,11 @@ export const deposit = async ({
erc20,
message,
}: {
signer: any;
amount: string;
to: string;
erc20?: string;
message?: string;
signer: any;
to: string;
}) => {
const { chainId } = signer.provider.network;
const chain = Object.entries(networks).find(
Expand All @@ -58,9 +59,9 @@ export const deposit = async ({
return await approveTx.wait();
} else {
return await signer.sendTransaction({
data: `${to}${message ?? ""}`,
to: tss,
value: ethers.utils.parseUnits(amount, 18),
data: `${to}${message ?? ""}`,
});
}
};
Expand Down Expand Up @@ -98,9 +99,9 @@ export const sendZRC20 = async (
destination === "btc_testnet"
? ethers.utils.toUtf8Bytes(recipient)
: recipient;
return await withdraw({ signer, amount, to, zrc20 });
return await withdraw({ amount, signer, to, zrc20 });
} else if (destination === "zeta_testnet") {
return await deposit({ signer, amount, to: recipient, erc20 });
return await deposit({ amount, erc20, signer, to: recipient });
} else {
throw new Error("Either network or destination should be zeta_testnet");
}
Expand Down
4 changes: 2 additions & 2 deletions tasks/sendZETA.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import confirm from "@inquirer/confirm";
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { sendZETA } from "../helpers/sendZETA";
import { fetchFees } from "../helpers/fees";
import confirm from "@inquirer/confirm";
import { sendZETA } from "../helpers/sendZETA";

declare const hre: any;

Expand Down
8 changes: 4 additions & 4 deletions tasks/sendZRC20.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import confirm from "@inquirer/confirm";
import { getChainId } from "@zetachain/networks";
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { fetchFees } from "../helpers/fees";

import { sendZRC20 } from "../helpers/sendZRC20";
import confirm from "@inquirer/confirm";
import { getChainId } from "@zetachain/networks";
import { getForeignCoins } from "../helpers/balances";
import { fetchFees } from "../helpers/fees";
import { sendZRC20 } from "../helpers/sendZRC20";

declare const hre: any;

Expand Down

0 comments on commit 0ca1110

Please sign in to comment.