From a727f69ffcc58d12ccfa61d8d7d96ecc7dab4806 Mon Sep 17 00:00:00 2001 From: GarmashAlex Date: Wed, 26 Feb 2025 19:22:47 +0300 Subject: [PATCH] Update logsManager.ts --- libs/remix-lib/src/execution/logsManager.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/remix-lib/src/execution/logsManager.ts b/libs/remix-lib/src/execution/logsManager.ts index 0beefd5b642..00ebb4d31d5 100644 --- a/libs/remix-lib/src/execution/logsManager.ts +++ b/libs/remix-lib/src/execution/logsManager.ts @@ -32,8 +32,8 @@ export class LogsManager { blockHash: bytesToHex(block.hash()), transactionHash: bytesToHex(tx.hash()), transactionIndex: '0x' + i.toString(16), - // TODO: if it's a contract deploy, it should be that address instead - address: log.address, + // Use contract address if it's a contract deployment + address: receipt.contractAddress || log.address, data: log.data, topics: log.topics } @@ -170,8 +170,8 @@ export class LogsManager { blockHash: bytesToHex(log.block.hash()), transactionHash: bytesToHex(log.tx.hash()), transactionIndex: '0x' + log.txNumber.toString(16), - // TODO: if it's a contract deploy, it should be that address instead - address: log.log.address, + // Use contract address if it's a contract deployment + address: log.receipt && log.receipt.contractAddress ? log.receipt.contractAddress : log.log.address, data: log.log.data, topics: log.log.topics } @@ -188,8 +188,8 @@ export class LogsManager { blockHash: bytesToHex(log.block.hash()), transactionHash: bytesToHex(log.tx.hash()), transactionIndex: '0x' + log.txNumber.toString(16), - // TODO: if it's a contract deploy, it should be that address instead - address: log.log.address, + // Use contract address if it's a contract deployment + address: log.receipt && log.receipt.contractAddress ? log.receipt.contractAddress : log.log.address, data: log.log.data, topics: log.log.topics })