Skip to content

Commit

Permalink
fix: update packages, use zksync-ethers
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Mar 1, 2024
1 parent 9499bfa commit 2a5805f
Show file tree
Hide file tree
Showing 12 changed files with 14,222 additions and 14,161 deletions.
6 changes: 3 additions & 3 deletions composables/transaction/useAllowance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BigNumber } from "ethers";

import IERC20 from "zksync-web3/abi/IERC20.json";
import IERC20 from "zksync-ethers/abi/IERC20.json";

import type { PublicClient, WalletClient } from "@wagmi/core";
import type { BigNumberish } from "ethers";
Expand Down Expand Up @@ -29,7 +29,7 @@ export default (
const publicClient = getPublicClient();
const allowance = (await publicClient.readContract({
address: tokenAddress.value as Hash,
abi: IERC20.abi,
abi: IERC20,
functionName: "allowance",
args: [accountAddress.value, contractAddress],
})) as bigint;
Expand Down Expand Up @@ -71,7 +71,7 @@ export default (
setAllowanceStatus.value = "waiting-for-signature";
setAllowanceTransactionHash.value = await wallet.writeContract({
address: tokenAddress.value as Hash,
abi: IERC20.abi,
abi: IERC20,
functionName: "approve",
args: [contractAddress, approvalAmount!.toString()],
});
Expand Down
4 changes: 2 additions & 2 deletions composables/zksync/deposit/useFee.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BigNumber } from "ethers";
import { parseEther } from "ethers/lib/utils";
import { L1_RECOMMENDED_MIN_ERC20_DEPOSIT_GAS_LIMIT } from "zksync-web3/build/src/utils";
import { L1_RECOMMENDED_MIN_ERC20_DEPOSIT_GAS_LIMIT } from "zksync-ethers/src/utils";

import type { PublicClient } from "@wagmi/core";
import type { BigNumberish } from "ethers";
import type { L1Signer } from "zksync-web3";
import type { L1Signer } from "zksync-ethers";
import type { Token, TokenAmount } from "@/types";
import useTimedCache from "@/composables/useTimedCache";

Expand Down
2 changes: 1 addition & 1 deletion composables/zksync/deposit/useTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BigNumberish } from "ethers";
import type { L1Signer } from "zksync-web3";
import type { L1Signer } from "zksync-ethers";
import useScreening from "@/composables/useScreening";

import type { DepositFeeValues } from "@/composables/zksync/deposit/useFee";
Expand Down
2 changes: 1 addition & 1 deletion composables/zksync/useFee.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BigNumber } from "ethers";

import type { BigNumberish } from "ethers";
import type { Provider } from "zksync-web3";
import type { Provider } from "zksync-ethers";
import useTimedCache from "@/composables/useTimedCache";

import type { Token, TokenAmount } from "@/types";
Expand Down
10 changes: 5 additions & 5 deletions composables/zksync/useWithdrawalFinalization.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useMemoize } from "@vueuse/core";
import { BigNumber, type BigNumberish } from "ethers";
import { Wallet } from "zksync-web3";
import { Wallet } from "zksync-ethers";

import ZkSyncL1BridgeInterface from "zksync-web3/abi/IL1Bridge.json";
import ZkSyncContractInterface from "zksync-web3/abi/IZkSync.json";
import ZkSyncL1BridgeAbi from "zksync-ethers/abi/IL1Bridge.json";
import ZkSyncContractAbi from "zksync-ethers/abi/IZkSync.json";

import type { Hash } from "@/types";

Expand Down Expand Up @@ -72,15 +72,15 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {
if (usingMainContract.value) {
return {
address: (await retrieveMainContractAddress()) as Hash,
abi: ZkSyncContractInterface.abi,
abi: ZkSyncContractAbi,
account: onboardStore.account.address!,
functionName: "finalizeEthWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
};
} else {
return {
address: (await retrieveBridgeAddress()) as Hash,
abi: ZkSyncL1BridgeInterface.abi,
abi: ZkSyncL1BridgeAbi,
account: onboardStore.account.address!,
functionName: "finalizeWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
Expand Down
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export default defineNuxtConfig({
runtimeConfig: {
public: {
walletConnectProjectID: process.env.WALLET_CONNECT_PROJECT_ID,
turnstileKey: process.env.TURNSTILE_KEY,
nodeType: process.env.NODE_TYPE as undefined | "memory" | "dockerized" | "hyperchain",
ankrToken: process.env.ANKR_TOKEN,
screeningApiUrl: process.env.SCREENING_API_URL,
Expand Down
Loading

0 comments on commit 2a5805f

Please sign in to comment.