import React from "react"; import { ParamType, Result } from "@ethersproject/abi"; import AddressHighlighter from "../components/AddressHighlighter"; import DecoratedAddressLink from "../components/DecoratedAddressLink"; import Copy from "../components/Copy"; import { TransactionData } from "../types"; type DecodedParamsTableProps = { args: Result; paramTypes: ParamType[]; txData: TransactionData; }; const DecodedParamsTable: React.FC = ({ args, paramTypes, txData, }) => ( {args.map((r, i) => ( ))}
param (index) type value
{paramTypes[i].name}{" "} ({i}) {paramTypes[i].type} {paramTypes[i].type === "address" ? (
) : paramTypes[i].type === "bool" ? ( {r.toString()} ) : paramTypes[i].type === "bytes" ? ( {r.toString()}{" "} {r.toString().length / 2 - 1}{" "} {r.toString().length / 2 - 1 === 1 ? "byte" : "bytes"} ) : ( r.toString() )}
); export default React.memo(DecodedParamsTable);