From cf1c23dfa82ac5366f7caa7e014c3d43380122d1 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 21 Jul 2021 15:13:18 -0300 Subject: [PATCH] Add contract creation tracing --- src/components/InternalCreate.tsx | 46 ++++++++++++++++++++++++++++ src/components/InternalOperation.tsx | 5 +++ src/types.ts | 2 ++ 3 files changed, 53 insertions(+) create mode 100644 src/components/InternalCreate.tsx diff --git a/src/components/InternalCreate.tsx b/src/components/InternalCreate.tsx new file mode 100644 index 0000000..e6291a4 --- /dev/null +++ b/src/components/InternalCreate.tsx @@ -0,0 +1,46 @@ +import React, { useContext } from "react"; +import { ethers } from "ethers"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faAngleRight, faBomb } from "@fortawesome/free-solid-svg-icons"; +import AddressHighlighter from "./AddressHighlighter"; +import DecoratedAddressLink from "./DecoratedAddressLink"; +import { TransactionData, Transfer } from "../types"; + +type InternalCreateProps = { + txData: TransactionData; + transfer: Transfer; +}; + +const InternalCreate: React.FC = ({ + txData, + transfer, +}) => { + return ( + <> +
+ + CREATE + + Contract +
+ + + +
+ + (Creator:{" "} + + + + ) + +
+ + ); +}; + +export default React.memo(InternalCreate); diff --git a/src/components/InternalOperation.tsx b/src/components/InternalOperation.tsx index 0ae0a38..e0abee4 100644 --- a/src/components/InternalOperation.tsx +++ b/src/components/InternalOperation.tsx @@ -1,6 +1,7 @@ import React from "react"; import InternalTransfer from "./InternalTransfer"; import InternalSelfDestruct from "./InternalSelfDestruct"; +import InternalCreate from "./InternalCreate"; import { TransactionData, Transfer, TransferType } from "../types"; type InternalOperationProps = { @@ -19,6 +20,10 @@ const InternalOperation: React.FC = ({ {transfer.type === TransferType.SELF_DESTRUCT && ( )} + {(transfer.type === TransferType.CREATE || + transfer.type === TransferType.CREATE2) && ( + + )} ); diff --git a/src/types.ts b/src/types.ts index 4c07826..104a722 100644 --- a/src/types.ts +++ b/src/types.ts @@ -75,6 +75,8 @@ export type From = { export enum TransferType { TRANSFER = 0, SELF_DESTRUCT = 1, + CREATE = 2, + CREATE2 = 3, } export type Transfer = {