diff --git a/src/components/InternalTransfer.tsx b/src/components/InternalTransfer.tsx index 0600e95..5a9f8cd 100644 --- a/src/components/InternalTransfer.tsx +++ b/src/components/InternalTransfer.tsx @@ -1,9 +1,11 @@ -import React from "react"; +import React, { useContext } from "react"; import { formatEther } from "@ethersproject/units"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleRight } from "@fortawesome/free-solid-svg-icons/faAngleRight"; import AddressHighlighter from "./AddressHighlighter"; import DecoratedAddressLink from "./DecoratedAddressLink"; +import { RuntimeContext } from "../useRuntime"; +import { useHasCode } from "../useErigonHooks"; import { TransactionData, InternalOperation } from "../types"; type InternalTransferProps = { @@ -22,6 +24,18 @@ const InternalTransfer: React.FC = ({ txData.confirmedData?.miner !== undefined && internalOp.to === txData.confirmedData.miner; + const { provider } = useContext(RuntimeContext); + const fromHasCode = useHasCode( + provider, + internalOp.from, + txData.confirmedData ? txData.confirmedData.blockNumber - 1 : undefined + ); + const toHasCode = useHasCode( + provider, + internalOp.to, + txData.confirmedData ? txData.confirmedData.blockNumber - 1 : undefined + ); + return (
@@ -41,6 +55,7 @@ const InternalTransfer: React.FC = ({ miner={fromMiner} txFrom={internalOp.from === txData.from} txTo={internalOp.from === txData.to} + eoa={fromHasCode === undefined ? undefined : !fromHasCode} />
@@ -58,6 +73,7 @@ const InternalTransfer: React.FC = ({ miner={toMiner} txFrom={internalOp.to === txData.from} txTo={internalOp.to === txData.to} + eoa={toHasCode === undefined ? undefined : !toHasCode} />