diff --git a/src/search/TransactionItem.tsx b/src/search/TransactionItem.tsx index 6d78f7e..bc84a6c 100644 --- a/src/search/TransactionItem.tsx +++ b/src/search/TransactionItem.tsx @@ -35,7 +35,10 @@ const TransactionItem: React.FC = ({ direction = Direction.SELF; } else if (tx.from === selectedAddress) { direction = Direction.OUT; - } else if (tx.to === selectedAddress) { + } else if ( + tx.to === selectedAddress || + tx.createdContractAddress === selectedAddress + ) { direction = Direction.IN; } else { direction = Direction.INTERNAL; @@ -44,6 +47,10 @@ const TransactionItem: React.FC = ({ const ensFrom = ensCache && tx.from && ensCache[tx.from]; const ensTo = ensCache && tx.to && ensCache[tx.to]; + const ensCreated = + ensCache && + tx.createdContractAddress && + ensCache[tx.createdContractAddress]; const flash = tx.gasPrice.isZero() && tx.internalMinerInteraction; return ( @@ -89,7 +96,7 @@ const TransactionItem: React.FC = ({ - {tx.to && ( + {tx.to ? ( = ({ miner={tx.miner === tx.to} /> + ) : ( + + + )} diff --git a/src/search/search.ts b/src/search/search.ts index a78eb81..e2d96c7 100644 --- a/src/search/search.ts +++ b/src/search/search.ts @@ -45,6 +45,7 @@ export class SearchController { hash: t.hash, from: t.from, to: t.to, + createdContractAddress: _receipt.contractAddress, value: t.value, fee: _receipt.gasUsed.mul(t.gasPrice!), gasPrice: t.gasPrice!, diff --git a/src/types.ts b/src/types.ts index 5b7dbc1..4c07826 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,6 +16,7 @@ export type ProcessedTransaction = { hash: string; from?: string; to?: string; + createdContractAddress?: string; internalMinerInteraction?: boolean; value: BigNumber; fee: BigNumber;