From 719ce4bd350b39fcca299dd38bbabbe208889a11 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 18 Oct 2021 19:04:43 -0300 Subject: [PATCH] Bugfix: do not try to decode method selector on contract creation txs fix #96 --- src/search/TransactionItem.tsx | 2 +- src/transaction/Details.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/search/TransactionItem.tsx b/src/search/TransactionItem.tsx index ffafc09..76e58e7 100644 --- a/src/search/TransactionItem.tsx +++ b/src/search/TransactionItem.tsx @@ -76,7 +76,7 @@ const TransactionItem: React.FC = ({ - + {tx.to !== null ? : } diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 716c529..0418456 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -72,7 +72,7 @@ const Details: React.FC = ({ } }, [txData]); - const fourBytes = rawInputTo4Bytes(txData.data); + const fourBytes = txData.to !== null ? rawInputTo4Bytes(txData.data) : "0x"; const fourBytesEntry = use4Bytes(fourBytes); const fourBytesTxDesc = useMemo(() => { if (!txData || !fourBytesEntry?.signature) { @@ -202,9 +202,11 @@ const Details: React.FC = ({ )} - - - + {txData.to && ( + + + + )} {txData.tokenTransfers.length > 0 && (