diff --git a/packages/data-fetcher/src/transaction/transaction.service.ts b/packages/data-fetcher/src/transaction/transaction.service.ts index 2dcf6efcd..de7e90471 100644 --- a/packages/data-fetcher/src/transaction/transaction.service.ts +++ b/packages/data-fetcher/src/transaction/transaction.service.ts @@ -5,6 +5,7 @@ import { types } from "zksync-ethers"; import { BlockchainService } from "../blockchain/blockchain.service"; import { TRANSACTION_PROCESSING_DURATION_METRIC_NAME, GET_TRANSACTION_INFO_DURATION_METRIC_NAME } from "../metrics"; import { LogService, LogsData } from "../log/log.service"; +import { getCreateAddress } from "ethers"; export interface TransactionInfo extends types.TransactionResponse { fee: string; @@ -83,8 +84,9 @@ export class TransactionService { const isEvmLike = transactionInfo.to === null; const toAddress = isEvmLike ? "0x" : transactionInfo.to; - const contractAddress = - isEvmLike && logsData.contractAddresses?.length > 0 ? logsData.contractAddresses[0].address : ""; + const contractAddress = isEvmLike + ? getCreateAddress({ from: transactionInfo.from, nonce: transactionInfo.nonce }) + : ""; const updatedTransactionInfo = { ...transactionInfo,