Skip to content

Commit

Permalink
fix: import zksync-ethers constants path error (matter-labs#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-stan authored Mar 20, 2024
1 parent 81792b4 commit 3928548
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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",
};

0 comments on commit 3928548

Please sign in to comment.