Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import zksync-ethers constants path error (zksync-ethers >= v0.5.6) #128

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/commands/transaction/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BigNumber, ethers } from "ethers";
import inquirer from "inquirer";
import ora from "ora";
import { utils } from "zksync-ethers";
import { BOOTLOADER_FORMAL_ADDRESS } from "zksync-ethers/build/src/utils.js";

import Program from "./command.js";
import { chainOption, l2RpcUrlOption } from "../../common/options.js";
Expand Down Expand Up @@ -50,7 +49,7 @@ export const handler = async (options: TransactionInfoOptions) => {
});
const totalFee = receipt.gasUsed.mul(receipt.effectiveGasPrice);
const refunded = transfers.reduce((acc, transfer) => {
if (transfer.from === BOOTLOADER_FORMAL_ADDRESS) {
if (transfer.from === utils.BOOTLOADER_FORMAL_ADDRESS) {
return acc.add(transfer.amount);
}
return acc;
Expand All @@ -61,7 +60,7 @@ export const handler = async (options: TransactionInfoOptions) => {
totalFee,
paidByPaymaster:
!transfers.length ||
receipt.from !== transfers.find((transfer) => transfer.from === BOOTLOADER_FORMAL_ADDRESS)?.to,
receipt.from !== transfers.find((transfer) => transfer.from === utils.BOOTLOADER_FORMAL_ADDRESS)?.to,
};
};
const getDecodedMethodSignature = async (hexSignature: string) => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getAddress } from "ethers/lib/utils.js";
import { L2_ETH_TOKEN_ADDRESS } from "zksync-ethers/build/src/utils.js";
import { utils } from "zksync-ethers";

export const ETH_TOKEN = {
symbol: "ETH",
name: "Ether",
decimals: 18,
address: getAddress(L2_ETH_TOKEN_ADDRESS),
address: getAddress(utils.L2_ETH_TOKEN_ADDRESS),
l1Address: "0x0000000000000000000000000000000000000000",
};
Loading