diff --git a/src/address/AddressTransactionResults.tsx b/src/address/AddressTransactionResults.tsx index e565427..ce7cf45 100644 --- a/src/address/AddressTransactionResults.tsx +++ b/src/address/AddressTransactionResults.tsx @@ -123,12 +123,12 @@ const AddressTransactionResults: React.FC = ({ } return _addresses; }, [address, page]); - const { sourcifySource } = useAppConfigContext(); const deduped = useDedupedAddresses(addresses); - const checked = useAddressesWithCode(provider, deduped); + const contracts = useAddressesWithCode(provider, deduped); + const { sourcifySource } = useAppConfigContext(); const metadatas = useMultipleMetadata( undefined, - checked, + contracts, provider?.network.chainId, sourcifySource ); diff --git a/src/block/BlockTransactionResults.tsx b/src/block/BlockTransactionResults.tsx index 59d1ba6..44caeb1 100644 --- a/src/block/BlockTransactionResults.tsx +++ b/src/block/BlockTransactionResults.tsx @@ -47,12 +47,12 @@ const BlockTransactionResults: React.FC = ({ return page.map((t) => t.to).filter((to): to is string => to !== undefined); }, [page]); - const { sourcifySource } = useAppConfigContext(); const deduped = useDedupedAddresses(addresses); - const checked = useAddressesWithCode(provider, deduped); + const contracts = useAddressesWithCode(provider, deduped); + const { sourcifySource } = useAppConfigContext(); const metadatas = useMultipleMetadata( undefined, - checked, + contracts, provider?.network.chainId, sourcifySource ); diff --git a/src/sourcify/useSourcify.ts b/src/sourcify/useSourcify.ts index 6b1e5d6..85baaaa 100644 --- a/src/sourcify/useSourcify.ts +++ b/src/sourcify/useSourcify.ts @@ -132,12 +132,10 @@ export const useSingleMetadata = ( }; export const useDedupedAddresses = ( - addresses: (ChecksummedAddress | undefined)[] + addresses: ChecksummedAddress[] ): ChecksummedAddress[] => { return useMemo(() => { - const deduped = new Set( - addresses.filter((a): a is ChecksummedAddress => a !== undefined) - ); + const deduped = new Set(addresses); return [...deduped]; }, [addresses]); }; diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 06e70d5..aa7d393 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -101,12 +101,12 @@ const Details: React.FC = ({ } return _addresses; }, [txData]); - const { sourcifySource } = useAppConfigContext(); const deduped = useDedupedAddresses(addresses); - const checked = useAddressesWithCode(provider, deduped); + const contracts = useAddressesWithCode(provider, deduped); + const { sourcifySource } = useAppConfigContext(); const metadatas = useMultipleMetadata( undefined, - checked, + contracts, provider?.network.chainId, sourcifySource ); diff --git a/src/transaction/Logs.tsx b/src/transaction/Logs.tsx index acc2baa..dedb178 100644 --- a/src/transaction/Logs.tsx +++ b/src/transaction/Logs.tsx @@ -35,12 +35,12 @@ const Logs: React.FC = ({ txData, metadata, resolvedAddresses }) => { [txData] ); const { provider } = useContext(RuntimeContext); - const { sourcifySource } = useAppConfigContext(); const deduped = useDedupedAddresses(logAddresses); - const checked = useAddressesWithCode(provider, deduped); + const contracts = useAddressesWithCode(provider, deduped); + const { sourcifySource } = useAppConfigContext(); const metadatas = useMultipleMetadata( baseMetadatas, - checked, + contracts, provider?.network.chainId, sourcifySource );