From 11ff5d9526e9e3dfef6fef7c59df1f782e39d362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 00:16:09 +0000 Subject: [PATCH 01/31] Bump @types/react from 17.0.20 to 17.0.24 (#73) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d80934..5b570d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", "@types/node": "^14.17.5", - "@types/react": "^17.0.20", + "@types/react": "^17.0.24", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.3", @@ -3090,9 +3090,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "17.0.20", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.20.tgz", - "integrity": "sha512-wWZrPlihslrPpcKyCSlmIlruakxr57/buQN1RjlIeaaTWDLtJkTtRW429MoQJergvVKc4IWBpRhWw7YNh/7GVA==", + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.24.tgz", + "integrity": "sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -21658,9 +21658,9 @@ "version": "1.5.4" }, "@types/react": { - "version": "17.0.20", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.20.tgz", - "integrity": "sha512-wWZrPlihslrPpcKyCSlmIlruakxr57/buQN1RjlIeaaTWDLtJkTtRW429MoQJergvVKc4IWBpRhWw7YNh/7GVA==", + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.24.tgz", + "integrity": "sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", diff --git a/package.json b/package.json index 67637e3..8de1a61 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", "@types/node": "^14.17.5", - "@types/react": "^17.0.20", + "@types/react": "^17.0.24", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.3", From 30e458c5476336bc546aaf191647db83f8264e9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 00:16:53 +0000 Subject: [PATCH 02/31] Bump @types/react-router-dom from 5.1.8 to 5.3.0 (#74) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b570d1..02003cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.3", - "@types/react-router-dom": "^5.1.8", + "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", "ethers": "^5.4.6", @@ -3133,9 +3133,9 @@ } }, "node_modules/@types/react-router-dom": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.8.tgz", - "integrity": "sha512-03xHyncBzG0PmDmf8pf3rehtjY0NpUj7TIN46FrT5n1ZWHPZvXz32gUyNboJ+xsL8cpg8bQVLcllptcQHvocrw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-svUzpEpKDwK8nmfV2vpZNSsiijFNKY8+gUqGqvGGOVrXvX58k1JIJubZa5igkwacbq/0umphO5SsQn/BQsnKpw==", "dependencies": { "@types/history": "*", "@types/react": "*", @@ -21701,9 +21701,9 @@ } }, "@types/react-router-dom": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.8.tgz", - "integrity": "sha512-03xHyncBzG0PmDmf8pf3rehtjY0NpUj7TIN46FrT5n1ZWHPZvXz32gUyNboJ+xsL8cpg8bQVLcllptcQHvocrw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-svUzpEpKDwK8nmfV2vpZNSsiijFNKY8+gUqGqvGGOVrXvX58k1JIJubZa5igkwacbq/0umphO5SsQn/BQsnKpw==", "requires": { "@types/history": "*", "@types/react": "*", diff --git a/package.json b/package.json index 8de1a61..d5a5f29 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.3", - "@types/react-router-dom": "^5.1.8", + "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", "ethers": "^5.4.6", From 0ede7cf3c9e9ab1e1b278376220f20d3a36b1cf6 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Thu, 23 Sep 2021 21:27:40 -0300 Subject: [PATCH 03/31] Migrate deprecated attribute activeClassname --- src/components/NavTab.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/NavTab.tsx b/src/components/NavTab.tsx index b8ff811..e16d193 100644 --- a/src/components/NavTab.tsx +++ b/src/components/NavTab.tsx @@ -6,13 +6,16 @@ type NavTabProps = { href: string; }; -// TODO: migrate activeClassName because of: https://github.com/remix-run/react-router/releases/tag/v5.3.0 -// TODO: @types/react-router-dom still doesn't support function in className const NavTab: React.FC = ({ href, children }) => ( + `${ + isActive + ? "text-link-blue border-link-blue" + : "text-gray-500 border-transparent" + } hover:text-link-blue text-sm font-bold px-3 py-3 border-b-2` + } to={href} exact replace From ef41c6a7a1bccf1111680996726635bd0722a570 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 00:30:28 +0000 Subject: [PATCH 04/31] Bump react-chartjs-2 from 3.0.4 to 3.0.5 (#69) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 02003cc..aeac813 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "query-string": "^7.0.1", "react": "^17.0.2", "react-blockies": "^1.4.1", - "react-chartjs-2": "^3.0.4", + "react-chartjs-2": "^3.0.5", "react-dom": "^17.0.2", "react-error-boundary": "^3.1.3", "react-image": "^4.0.3", @@ -14425,14 +14425,14 @@ } }, "node_modules/react-chartjs-2": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.0.4.tgz", - "integrity": "sha512-pcbFNpkPMTkGXXJ7k7hnukbRD0ZV01qB6JQY1ontITc2IYvhGlK6BBDy28VeydYs1Dl/c5ZpRgRVEtT5GUnxcQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.0.5.tgz", + "integrity": "sha512-fYr4E82agaZi9IFMe5GtOZ6WE/HWdxy/KywLNOzXsqgPkD2oo1IlrQLKMLUki/2UXko3p95TR2L8Q2rEss/opQ==", "dependencies": { "lodash": "^4.17.19" }, "peerDependencies": { - "chart.js": "^3.1.0", + "chart.js": "^3.5.0", "react": "^16.8.0 || ^17.0.0" } }, @@ -29288,9 +29288,9 @@ } }, "react-chartjs-2": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.0.4.tgz", - "integrity": "sha512-pcbFNpkPMTkGXXJ7k7hnukbRD0ZV01qB6JQY1ontITc2IYvhGlK6BBDy28VeydYs1Dl/c5ZpRgRVEtT5GUnxcQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.0.5.tgz", + "integrity": "sha512-fYr4E82agaZi9IFMe5GtOZ6WE/HWdxy/KywLNOzXsqgPkD2oo1IlrQLKMLUki/2UXko3p95TR2L8Q2rEss/opQ==", "requires": { "lodash": "^4.17.19" } diff --git a/package.json b/package.json index d5a5f29..96ba0b7 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "query-string": "^7.0.1", "react": "^17.0.2", "react-blockies": "^1.4.1", - "react-chartjs-2": "^3.0.4", + "react-chartjs-2": "^3.0.5", "react-dom": "^17.0.2", "react-error-boundary": "^3.1.3", "react-image": "^4.0.3", From 090ff2ba042771c04d50e55423d39937c9470f75 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Thu, 23 Sep 2021 21:33:08 -0300 Subject: [PATCH 05/31] Update trustwallet assets --- trustwallet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trustwallet b/trustwallet index 7bfa06a..d612796 160000 --- a/trustwallet +++ b/trustwallet @@ -1 +1 @@ -Subproject commit 7bfa06acc125a4874d86bc1fa8e4547a46846e31 +Subproject commit d612796060acaa8a621b1dd25c1a41a24452953e From fef8bbae1d14defd610da320f66004084b1dfbd5 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 24 Sep 2021 01:07:24 -0300 Subject: [PATCH 06/31] Add 4bytes signatures with param names to docker image --- .dockerignore | 1 + Dockerfile | 1 + nginx.conf | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/.dockerignore b/.dockerignore index df120e1..ee24273 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,5 +2,6 @@ node_modules 4bytes !4bytes/signatures +!4bytes/with_parameter_names trustwallet !trustwallet/blockchains/ethereum/assets diff --git a/Dockerfile b/Dockerfile index 7583d23..223578a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN find . -name logo.png | parallel magick convert {} -filter Lanczos -resize 3 FROM nginx:1.21.1-alpine RUN apk add jq COPY 4bytes/signatures /usr/share/nginx/html/signatures/ +COPY 4bytes/with_parameter_names /usr/share/nginx/html/with_parameter_names/ COPY --from=logobuilder /assets /usr/share/nginx/html/assets/ COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /otterscan-build/build /usr/share/nginx/html/ diff --git a/nginx.conf b/nginx.conf index 55189ba..8e55be6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -43,6 +43,40 @@ server { } } + location /with_parameter_names { + root /usr/share/nginx/html; + expires 30d; + + # Base on: https://michielkalkman.com/snippets/nginx-cors-open-configuration/ + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + # + # Om nom nom cookies + # + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; + + # + # Custom headers and headers various browsers *should* be OK with but aren't + # + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + + # + # Tell client that this pre-flight info is valid for 20 days + # + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + if ($request_method = 'GET') { + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; + add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always; + } + } + location /assets { root /usr/share/nginx/html; expires 30d; From ccb33b463748d7b4353653c403c4b6f0b2013c23 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 06:51:50 -0300 Subject: [PATCH 07/31] First working version of tx input decoding from 4bytes DB; if there is 4bytes AND sourcify info, prioritize sourcify for completeness --- src/transaction/Details.tsx | 31 ++++++++++-- src/use4Bytes.ts | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 5 deletions(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index bea1587..57a0233 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -1,5 +1,9 @@ import React, { useMemo } from "react"; -import { TransactionDescription } from "@ethersproject/abi"; +import { + TransactionDescription, + Fragment, + Interface, +} from "@ethersproject/abi"; import { BigNumber } from "@ethersproject/bignumber"; import { toUtf8String } from "@ethersproject/strings"; import { Tab } from "@headlessui/react"; @@ -32,6 +36,7 @@ import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; import ModeTab from "../components/ModeTab"; import DecodedParamsTable from "./DecodedParamsTable"; +import { rawInputTo4Bytes, use4BytesFull } from "../use4Bytes"; type DetailsProps = { txData: TransactionData; @@ -62,6 +67,20 @@ const Details: React.FC = ({ } }, [txData]); + const fourBytes = rawInputTo4Bytes(txData.data); + const fourBytesEntry = use4BytesFull(fourBytes); + const fourBytesTxDesc = useMemo(() => { + if (!txData || !fourBytesEntry?.signatureWithoutParamNames) { + return undefined; + } + const sig = fourBytesEntry?.signatureWithoutParamNames; + const functionFragment = Fragment.fromString(`function ${sig}`); + const intf = new Interface([functionFragment]); + return intf.parseTransaction({ data: txData.data, value: txData.value }); + }, [txData, fourBytesEntry]); + + const resolvedTxDesc = txDesc ?? fourBytesTxDesc; + return ( @@ -322,14 +341,16 @@ const Details: React.FC = ({ - {txDesc === undefined ? ( + {fourBytes === "0x" ? ( + <>No parameters + ) : resolvedTxDesc === undefined ? ( <>Waiting for data... - ) : txDesc === null ? ( + ) : resolvedTxDesc === null ? ( <>No decoded data ) : ( )} diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index dad9f75..5f837e6 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -4,6 +4,21 @@ import { fourBytesURL } from "./url"; const cache = new Map(); +export type FourBytesEntry = { + name: string; + signatureWithoutParamNames: string | undefined; + signatures: string[] | undefined; +}; + +const simpleTransfer: FourBytesEntry = { + name: "Transfer", + signatureWithoutParamNames: undefined, + signatures: undefined, +}; + +const fullCache = new Map(); + +// TODO: deprecate and remove export const use4Bytes = (rawFourBytes: string) => { const runtime = useContext(RuntimeContext); const assetsURLPrefix = runtime.config?.assetsURLPrefix; @@ -68,3 +83,85 @@ export const use4Bytes = (rawFourBytes: string) => { return name; }; + +export const rawInputTo4Bytes = (rawInput: string) => rawInput.substr(0, 10); + +/** + * Extract 4bytes DB info + * + * @param rawFourBytes an hex string containing the 4bytes signature in the "0xXXXXXXXX" format. + */ +export const use4BytesFull = ( + rawFourBytes: string +): FourBytesEntry | null | undefined => { + if (rawFourBytes !== "0x") { + if (rawFourBytes.length !== 10 || !rawFourBytes.startsWith("0x")) { + throw new Error( + `rawFourBytes must contain a 4 bytes hex method signature starting with 0x; received value: "${rawFourBytes}"` + ); + } + } + + const runtime = useContext(RuntimeContext); + const assetsURLPrefix = runtime.config?.assetsURLPrefix; + + const fourBytes = rawFourBytes.slice(2); + const [entry, setEntry] = useState( + fullCache.get(fourBytes) + ); + useEffect(() => { + if (assetsURLPrefix === undefined) { + return; + } + if (fourBytes === "") { + return; + } + + const signatureURL = fourBytesURL(assetsURLPrefix, fourBytes); + fetch(signatureURL) + .then(async (res) => { + if (!res.ok) { + console.error(`Signature does not exist in 4bytes DB: ${fourBytes}`); + fullCache.set(fourBytes, null); + setEntry(null); + return; + } + + const sig = await res.text(); + const cut = sig.indexOf("("); + let method = sig.slice(0, cut); + method = method.charAt(0).toUpperCase() + method.slice(1); + + const entry: FourBytesEntry = { + name: method, + signatureWithoutParamNames: sig, + signatures: undefined, + }; + setEntry(entry); + fullCache.set(fourBytes, entry); + }) + .catch((err) => { + console.error(`Couldn't fetch signature URL ${signatureURL}`, err); + setEntry(null); + fullCache.set(fourBytes, null); + }); + }, [fourBytes, assetsURLPrefix]); + + if (rawFourBytes === "0x") { + return simpleTransfer; + } + if (assetsURLPrefix === undefined) { + return undefined; + } + + // Try to resolve 4bytes name + if (entry === null || entry === undefined) { + return entry; + } + + // Simulates LRU + // TODO: implement LRU purging + fullCache.delete(fourBytes); + fullCache.set(fourBytes, entry); + return entry; +}; From b57518ba964bcfa7fbcab9e5df3bdd9d18814972 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 14:29:09 -0300 Subject: [PATCH 08/31] Use common function --- src/components/MethodName.tsx | 4 ++-- src/use4Bytes.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/MethodName.tsx b/src/components/MethodName.tsx index 1ed596d..ff45cae 100644 --- a/src/components/MethodName.tsx +++ b/src/components/MethodName.tsx @@ -1,12 +1,12 @@ import React from "react"; -import { use4Bytes } from "../use4Bytes"; +import { rawInputTo4Bytes, use4Bytes } from "../use4Bytes"; type MethodNameProps = { data: string; }; const MethodName: React.FC = ({ data }) => { - const rawFourBytes = data.slice(0, 10); + const rawFourBytes = rawInputTo4Bytes(data); const methodName = use4Bytes(rawFourBytes); const isSimpleTransfer = data === "0x"; const methodTitle = isSimpleTransfer diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index 5f837e6..a1ab465 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -84,7 +84,7 @@ export const use4Bytes = (rawFourBytes: string) => { return name; }; -export const rawInputTo4Bytes = (rawInput: string) => rawInput.substr(0, 10); +export const rawInputTo4Bytes = (rawInput: string) => rawInput.slice(0, 10); /** * Extract 4bytes DB info From e4fa639e691d329f182116da91ccf73943a4e9e0 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 14:45:12 -0300 Subject: [PATCH 09/31] Add warning for input decoded from 4bytes signatures wuthout param names --- src/transaction/DecodedParamRow.tsx | 5 +++-- src/transaction/DecodedParamsTable.tsx | 9 ++++++++- src/transaction/Details.tsx | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/transaction/DecodedParamRow.tsx b/src/transaction/DecodedParamRow.tsx index 9d9bcf8..5678ac8 100644 --- a/src/transaction/DecodedParamRow.tsx +++ b/src/transaction/DecodedParamRow.tsx @@ -25,7 +25,7 @@ const DecodedParamRow: React.FC = ({ {prefix && {prefix}} - {paramType.name}{" "} + {paramType.name ?? param_{i}}{" "} {i !== undefined && ( ({i}) )} @@ -65,7 +65,8 @@ const DecodedParamRow: React.FC = ({ {paramType.baseType === "tuple" && r.map((e: any, idx: number) => ( - = ({ args, paramTypes, txData, + hasParamNames = true, }) => ( - +
+ {!hasParamNames && ( + + + + )} {args.map((r, i) => ( diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 57a0233..27bd9b1 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -352,6 +352,7 @@ const Details: React.FC = ({ args={resolvedTxDesc.args} paramTypes={resolvedTxDesc.functionFragment.inputs} txData={txData} + hasParamNames={resolvedTxDesc === txDesc} /> )} From f612e4791a1ec589acd9f247bc0b62d518b4a353 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 15:11:57 -0300 Subject: [PATCH 10/31] Better display of array tx input parameters --- src/transaction/DecodedParamRow.tsx | 34 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/transaction/DecodedParamRow.tsx b/src/transaction/DecodedParamRow.tsx index 5678ac8..aec65ce 100644 --- a/src/transaction/DecodedParamRow.tsx +++ b/src/transaction/DecodedParamRow.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { ReactNode } from "react"; import AddressHighlighter from "../components/AddressHighlighter"; import DecoratedAddressLink from "../components/DecoratedAddressLink"; import Copy from "../components/Copy"; @@ -6,11 +6,12 @@ import { ParamType } from "@ethersproject/abi"; import { TransactionData } from "../types"; type DecodedParamRowProps = { - prefix?: string; + prefix?: ReactNode; i?: number | undefined; r: any; paramType: ParamType; txData: TransactionData; + arrayElem?: number | undefined; }; const DecodedParamRow: React.FC = ({ @@ -19,15 +20,24 @@ const DecodedParamRow: React.FC = ({ r, paramType, txData, + arrayElem, }) => { return ( <> @@ -56,7 +66,8 @@ const DecodedParamRow: React.FC = ({ {r.toString().length / 2 - 1 === 1 ? "byte" : "bytes"} - ) : paramType.baseType === "tuple" ? ( + ) : paramType.baseType === "tuple" || + paramType.baseType === "array" ? ( <> ) : ( r.toString() @@ -73,6 +84,17 @@ const DecodedParamRow: React.FC = ({ txData={txData} /> ))} + {paramType.baseType === "array" && + r.map((e: any, idx: number) => ( + param_{i}} + r={e} + paramType={paramType.arrayChildren} + txData={txData} + arrayElem={idx} + /> + ))} ); }; From 1b127b84a248dc92fa63b111e32fb285cc0662d6 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 17:19:49 -0300 Subject: [PATCH 11/31] Move into subpackage --- src/transaction/Details.tsx | 2 +- src/transaction/LogEntry.tsx | 4 ++-- src/transaction/{ => decoder}/DecodedLogSignature.tsx | 0 src/transaction/{ => decoder}/DecodedParamRow.tsx | 11 ++++++----- src/transaction/{ => decoder}/DecodedParamsTable.tsx | 6 ++++-- 5 files changed, 13 insertions(+), 10 deletions(-) rename src/transaction/{ => decoder}/DecodedLogSignature.tsx (100%) rename src/transaction/{ => decoder}/DecodedParamRow.tsx (91%) rename src/transaction/{ => decoder}/DecodedParamsTable.tsx (88%) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 27bd9b1..5fb100a 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -35,7 +35,7 @@ import ExternalLink from "../components/ExternalLink"; import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; import ModeTab from "../components/ModeTab"; -import DecodedParamsTable from "./DecodedParamsTable"; +import DecodedParamsTable from "./decoder/DecodedParamsTable"; import { rawInputTo4Bytes, use4BytesFull } from "../use4Bytes"; type DetailsProps = { diff --git a/src/transaction/LogEntry.tsx b/src/transaction/LogEntry.tsx index 1d4e85f..e06c558 100644 --- a/src/transaction/LogEntry.tsx +++ b/src/transaction/LogEntry.tsx @@ -6,8 +6,8 @@ import AddressHighlighter from "../components/AddressHighlighter"; import DecoratedAddressLink from "../components/DecoratedAddressLink"; import Copy from "../components/Copy"; import ModeTab from "../components/ModeTab"; -import DecodedParamsTable from "./DecodedParamsTable"; -import DecodedLogSignature from "./DecodedLogSignature"; +import DecodedParamsTable from "./decoder/DecodedParamsTable"; +import DecodedLogSignature from "./decoder/DecodedLogSignature"; import { TransactionData } from "../types"; type LogEntryProps = { diff --git a/src/transaction/DecodedLogSignature.tsx b/src/transaction/decoder/DecodedLogSignature.tsx similarity index 100% rename from src/transaction/DecodedLogSignature.tsx rename to src/transaction/decoder/DecodedLogSignature.tsx diff --git a/src/transaction/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx similarity index 91% rename from src/transaction/DecodedParamRow.tsx rename to src/transaction/decoder/DecodedParamRow.tsx index aec65ce..79bc6d5 100644 --- a/src/transaction/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -1,9 +1,9 @@ import React, { ReactNode } from "react"; -import AddressHighlighter from "../components/AddressHighlighter"; -import DecoratedAddressLink from "../components/DecoratedAddressLink"; -import Copy from "../components/Copy"; import { ParamType } from "@ethersproject/abi"; -import { TransactionData } from "../types"; +import AddressHighlighter from "../../components/AddressHighlighter"; +import DecoratedAddressLink from "../../components/DecoratedAddressLink"; +import Copy from "../../components/Copy"; +import { TransactionData } from "../../types"; type DecodedParamRowProps = { prefix?: ReactNode; @@ -28,7 +28,8 @@ const DecodedParamRow: React.FC = ({ {!hasParamNames && ( - + )} From ab7ac37ca07157aa196433d2e1239dcf93f18528 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 17:28:49 -0300 Subject: [PATCH 12/31] Extract decoders --- src/transaction/decoder/AddressDecoder.tsx | 26 ++++ src/transaction/decoder/BooleanDecoder.tsx | 13 ++ src/transaction/decoder/BytesDecoder.tsx | 17 +++ src/transaction/decoder/DecodedParamRow.tsx | 141 +++++++++----------- 4 files changed, 116 insertions(+), 81 deletions(-) create mode 100644 src/transaction/decoder/AddressDecoder.tsx create mode 100644 src/transaction/decoder/BooleanDecoder.tsx create mode 100644 src/transaction/decoder/BytesDecoder.tsx diff --git a/src/transaction/decoder/AddressDecoder.tsx b/src/transaction/decoder/AddressDecoder.tsx new file mode 100644 index 0000000..ee6369a --- /dev/null +++ b/src/transaction/decoder/AddressDecoder.tsx @@ -0,0 +1,26 @@ +import React from "react"; +import AddressHighlighter from "../../components/AddressHighlighter"; +import DecoratedAddressLink from "../../components/DecoratedAddressLink"; +import Copy from "../../components/Copy"; +import { TransactionData } from "../../types"; + +type AddressDecoderProps = { + r: any; + txData: TransactionData; +}; + +const AddressDecoder: React.FC = ({ r, txData }) => ( +
+ + + + +
+); + +export default React.memo(AddressDecoder); diff --git a/src/transaction/decoder/BooleanDecoder.tsx b/src/transaction/decoder/BooleanDecoder.tsx new file mode 100644 index 0000000..259f4a9 --- /dev/null +++ b/src/transaction/decoder/BooleanDecoder.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +type BooleanDecoderProps = { + r: any; +}; + +const BooleanDecoder: React.FC = ({ r }) => ( + + {r.toString()} + +); + +export default React.memo(BooleanDecoder); diff --git a/src/transaction/decoder/BytesDecoder.tsx b/src/transaction/decoder/BytesDecoder.tsx new file mode 100644 index 0000000..f7de95f --- /dev/null +++ b/src/transaction/decoder/BytesDecoder.tsx @@ -0,0 +1,17 @@ +import React from "react"; + +type BytesDecoderProps = { + r: any; +}; + +const BytesDecoder: React.FC = ({ r }) => ( + + {r.toString()}{" "} + + {r.toString().length / 2 - 1}{" "} + {r.toString().length / 2 - 1 === 1 ? "byte" : "bytes"} + + +); + +export default React.memo(BytesDecoder); diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index 79bc6d5..493f6b3 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -1,8 +1,8 @@ import React, { ReactNode } from "react"; import { ParamType } from "@ethersproject/abi"; -import AddressHighlighter from "../../components/AddressHighlighter"; -import DecoratedAddressLink from "../../components/DecoratedAddressLink"; -import Copy from "../../components/Copy"; +import AddressDecoder from "./AddressDecoder"; +import BooleanDecoder from "./BooleanDecoder"; +import BytesDecoder from "./BytesDecoder"; import { TransactionData } from "../../types"; type DecodedParamRowProps = { @@ -21,83 +21,62 @@ const DecodedParamRow: React.FC = ({ paramType, txData, arrayElem, -}) => { - return ( - <> -
- - - - - {paramType.baseType === "tuple" && - r.map((e: any, idx: number) => ( - - ))} - {paramType.baseType === "array" && - r.map((e: any, idx: number) => ( - param_{i}} - r={e} - paramType={paramType.arrayChildren} - txData={txData} - arrayElem={idx} - /> - ))} - - ); -}; +}) => ( + <> + + + + + + {paramType.baseType === "tuple" && + r.map((e: any, idx: number) => ( + + ))} + {paramType.baseType === "array" && + r.map((e: any, idx: number) => ( + param_{i}} + r={e} + paramType={paramType.arrayChildren} + txData={txData} + arrayElem={idx} + /> + ))} + +); export default React.memo(DecodedParamRow); From a1da1d532b8e54d82e38ed2d3a1593bc851e4413 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 18:40:00 -0300 Subject: [PATCH 13/31] Add uint256 decoder with display mode toggler --- src/transaction/decoder/DecodedParamRow.tsx | 5 +- src/transaction/decoder/Uint256Decoder.tsx | 58 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/transaction/decoder/Uint256Decoder.tsx diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index 493f6b3..f0f0013 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -1,5 +1,6 @@ import React, { ReactNode } from "react"; import { ParamType } from "@ethersproject/abi"; +import Uint256Decoder from "./Uint256Decoder"; import AddressDecoder from "./AddressDecoder"; import BooleanDecoder from "./BooleanDecoder"; import BytesDecoder from "./BytesDecoder"; @@ -42,7 +43,9 @@ const DecodedParamRow: React.FC = ({ )} diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index 622f327..9fe9252 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -4,14 +4,12 @@ import { fourBytesURL } from "./url"; export type FourBytesEntry = { name: string; - signatureWithoutParamNames: string | undefined; - signatures: string[] | undefined; + signature: string | undefined; }; const simpleTransfer: FourBytesEntry = { name: "Transfer", - signatureWithoutParamNames: undefined, - signatures: undefined, + signature: undefined, }; const fullCache = new Map(); @@ -68,8 +66,7 @@ export const use4Bytes = ( const entry: FourBytesEntry = { name: method, - signatureWithoutParamNames: sig, - signatures: undefined, + signature: sig, }; setEntry(entry); fullCache.set(fourBytes, entry); From a4db3735332cd0d9e66768f5993ad7de58d9d49e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 18:55:39 +0000 Subject: [PATCH 20/31] Bump @chainlink/contracts from 0.2.1 to 0.2.2 (#77) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeac813..70ae1f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@blackbox-vision/react-qr-reader": "^5.0.0", - "@chainlink/contracts": "^0.2.1", + "@chainlink/contracts": "^0.2.2", "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", "@fontsource/roboto": "^4.5.0", @@ -1228,9 +1228,9 @@ } }, "node_modules/@chainlink/contracts": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.2.1.tgz", - "integrity": "sha512-mAQgPQKiqW3tLMlp31NgcnXpwG3lttgKU0izAqKiirJ9LH7rQ+O0oHIVR5Qp2yuqgmfbLsgfdLo4GcVC8IFz3Q==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.2.2.tgz", + "integrity": "sha512-wxXPbt7O3aZaUSG34ufFASC5amRSL6eeYCqsa+2gpqbB8Hk7B7FydEDCI5dqvAC444TlFskPHcVbizCZkRHPpw==" }, "node_modules/@cnakazawa/watch": { "version": "1.0.4", @@ -20513,9 +20513,9 @@ } }, "@chainlink/contracts": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.2.1.tgz", - "integrity": "sha512-mAQgPQKiqW3tLMlp31NgcnXpwG3lttgKU0izAqKiirJ9LH7rQ+O0oHIVR5Qp2yuqgmfbLsgfdLo4GcVC8IFz3Q==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.2.2.tgz", + "integrity": "sha512-wxXPbt7O3aZaUSG34ufFASC5amRSL6eeYCqsa+2gpqbB8Hk7B7FydEDCI5dqvAC444TlFskPHcVbizCZkRHPpw==" }, "@cnakazawa/watch": { "version": "1.0.4", diff --git a/package.json b/package.json index 1cf8dfc..1bd82e8 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "dependencies": { "@blackbox-vision/react-qr-reader": "^5.0.0", - "@chainlink/contracts": "^0.2.1", + "@chainlink/contracts": "^0.2.2", "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", "@fontsource/roboto": "^4.5.0", From 0242c4fa0aae2bab04f829c9f68c453a34e759dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 18:57:32 +0000 Subject: [PATCH 21/31] Bump @types/react-highlight from 0.12.3 to 0.12.4 (#76) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70ae1f0..839ef62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "@types/react": "^17.0.24", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", - "@types/react-highlight": "^0.12.3", + "@types/react-highlight": "^0.12.4", "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", @@ -3116,9 +3116,9 @@ } }, "node_modules/@types/react-highlight": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/@types/react-highlight/-/react-highlight-0.12.3.tgz", - "integrity": "sha512-mfhuHdE3dUjvRv1lvZIvda2B+VW7rkG1ufnFLKbDcRUp/L73bGUmEuEfpnjgdLgeWYho88ahQZRcMSh9GsZA0g==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/@types/react-highlight/-/react-highlight-0.12.4.tgz", + "integrity": "sha512-eq+1LUJYDTpZMx31KD3e8K0OJcfUlgWaxYGldKfD7uMkmg04x6O2+h6kG7Rm0SY1+XkeBWYhg2lyIFv8WpGrLQ==", "dependencies": { "@types/react": "*" } @@ -21684,9 +21684,9 @@ } }, "@types/react-highlight": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/@types/react-highlight/-/react-highlight-0.12.3.tgz", - "integrity": "sha512-mfhuHdE3dUjvRv1lvZIvda2B+VW7rkG1ufnFLKbDcRUp/L73bGUmEuEfpnjgdLgeWYho88ahQZRcMSh9GsZA0g==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/@types/react-highlight/-/react-highlight-0.12.4.tgz", + "integrity": "sha512-eq+1LUJYDTpZMx31KD3e8K0OJcfUlgWaxYGldKfD7uMkmg04x6O2+h6kG7Rm0SY1+XkeBWYhg2lyIFv8WpGrLQ==", "requires": { "@types/react": "*" } diff --git a/package.json b/package.json index 1bd82e8..3c1e0b6 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@types/react": "^17.0.24", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", - "@types/react-highlight": "^0.12.3", + "@types/react-highlight": "^0.12.4", "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", From 0674660d1d76f991ccc8593af4d8a2e3cdc9a3ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 18:58:31 +0000 Subject: [PATCH 22/31] Bump autoprefixer from 9.8.6 to 9.8.7 (#79) --- package-lock.json | 25 +++++++++++++++++++------ package.json | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 839ef62..a75d98f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "web-vitals": "^1.0.1" }, "devDependencies": { - "autoprefixer": "^9.8.6", + "autoprefixer": "^9.8.7", "postcss": "^7.0.36", "source-map-explorer": "^2.5.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.6" @@ -4163,12 +4163,13 @@ } }, "node_modules/autoprefixer": { - "version": "9.8.6", - "license": "MIT", + "version": "9.8.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.7.tgz", + "integrity": "sha512-7Hg99B1eTH5+LgmUBUSmov1Z3bsggQJS7v3IMGo6wcScnbRuvtMc871J9J+4bSbIqa9LSX/zypFXJ8sXHpMJeQ==", "dependencies": { "browserslist": "^4.12.0", "caniuse-lite": "^1.0.30001109", - "colorette": "^1.2.1", + "nanocolors": "^0.2.8", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", "postcss": "^7.0.32", @@ -11877,6 +11878,11 @@ "license": "MIT", "optional": true }, + "node_modules/nanocolors": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.10.tgz", + "integrity": "sha512-i+EDWGsJClQwR/bhLIG/CObZZwaYaS5qt+yjxZbfV+77QiNHNzE9nj4d9Ut1TGZ0R0eSwPcQWzReASzXuw/7oA==" + }, "node_modules/nanoid": { "version": "3.1.23", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", @@ -22381,11 +22387,13 @@ "version": "2.1.2" }, "autoprefixer": { - "version": "9.8.6", + "version": "9.8.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.7.tgz", + "integrity": "sha512-7Hg99B1eTH5+LgmUBUSmov1Z3bsggQJS7v3IMGo6wcScnbRuvtMc871J9J+4bSbIqa9LSX/zypFXJ8sXHpMJeQ==", "requires": { "browserslist": "^4.12.0", "caniuse-lite": "^1.0.30001109", - "colorette": "^1.2.1", + "nanocolors": "^0.2.8", "normalize-range": "^0.1.2", "num2fraction": "^1.2.2", "postcss": "^7.0.32", @@ -27562,6 +27570,11 @@ "version": "2.14.2", "optional": true }, + "nanocolors": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.10.tgz", + "integrity": "sha512-i+EDWGsJClQwR/bhLIG/CObZZwaYaS5qt+yjxZbfV+77QiNHNzE9nj4d9Ut1TGZ0R0eSwPcQWzReASzXuw/7oA==" + }, "nanoid": { "version": "3.1.23", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", diff --git a/package.json b/package.json index 3c1e0b6..0fa67bd 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ ] }, "devDependencies": { - "autoprefixer": "^9.8.6", + "autoprefixer": "^9.8.7", "postcss": "^7.0.36", "source-map-explorer": "^2.5.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.6" From deabb9cb2f73cf70a67c553a9db515692cdbe7dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 19:00:55 +0000 Subject: [PATCH 23/31] Bump postcss from 7.0.36 to 7.0.38 (#78) --- package-lock.json | 106 +++++----------------------------------------- package.json | 2 +- 2 files changed, 12 insertions(+), 96 deletions(-) diff --git a/package-lock.json b/package-lock.json index a75d98f..70d7935 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ }, "devDependencies": { "autoprefixer": "^9.8.7", - "postcss": "^7.0.36", + "postcss": "^7.0.38", "source-map-explorer": "^2.5.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.6" } @@ -12891,13 +12891,12 @@ } }, "node_modules/postcss": { - "version": "7.0.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", - "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "version": "7.0.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.38.tgz", + "integrity": "sha512-wNrSHWjHDQJR/IZL5IKGxRtFgrYNaAA/UrkW2WqbtZO6uxSLMxMN+s2iqUMwnAWm3fMROlDYZB41dr0Mt7vBwQ==", "dependencies": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" + "nanocolors": "^0.2.2", + "source-map": "^0.6.1" }, "engines": { "node": ">=6.0.0" @@ -13956,55 +13955,6 @@ "node": ">=6.14.4" } }, - "node_modules/postcss/node_modules/ansi-styles": { - "version": "3.2.1", - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss/node_modules/chalk": { - "version": "2.4.2", - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss/node_modules/chalk/node_modules/supports-color": { - "version": "5.5.0", - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss/node_modules/escape-string-regexp": { - "version": "1.0.5", - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/postcss/node_modules/supports-color": { - "version": "6.1.0", - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/prelude-ls": { "version": "1.1.2", "engines": { @@ -28225,46 +28175,12 @@ "version": "0.1.1" }, "postcss": { - "version": "7.0.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", - "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "version": "7.0.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.38.tgz", + "integrity": "sha512-wNrSHWjHDQJR/IZL5IKGxRtFgrYNaAA/UrkW2WqbtZO6uxSLMxMN+s2iqUMwnAWm3fMROlDYZB41dr0Mt7vBwQ==", "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "escape-string-regexp": { - "version": "1.0.5" - }, - "supports-color": { - "version": "6.1.0", - "requires": { - "has-flag": "^3.0.0" - } - } + "nanocolors": "^0.2.2", + "source-map": "^0.6.1" } }, "postcss-attribute-case-insensitive": { diff --git a/package.json b/package.json index 0fa67bd..871f199 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ }, "devDependencies": { "autoprefixer": "^9.8.7", - "postcss": "^7.0.36", + "postcss": "^7.0.38", "source-map-explorer": "^2.5.2", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.6" } From 9b85c0fb8e2db7eebff782249d48be191f0c5029 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 19:01:46 +0000 Subject: [PATCH 24/31] Bump @fontsource/roboto from 4.5.0 to 4.5.1 (#80) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70d7935..b2dc605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@chainlink/contracts": "^0.2.2", "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", - "@fontsource/roboto": "^4.5.0", + "@fontsource/roboto": "^4.5.1", "@fontsource/roboto-mono": "^4.5.0", "@fontsource/space-grotesk": "^4.5.0", "@fortawesome/fontawesome-svg-core": "^1.2.36", @@ -2017,9 +2017,9 @@ "integrity": "sha512-8KTCsfs5m3UgICpHLglIKAS7vc2FFOu7/vvpWcE/42SWbh+9X8EJbEyJp6W96kU5iDVlAlUv4Cqc36Z9XUpLmA==" }, "node_modules/@fontsource/roboto": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.0.tgz", - "integrity": "sha512-ja4XYw/9kNRFM5Ndk9vwzHWsdBMXczyBazFkTXJQ74QQBnT0BbSsHn0pF60AU0Iznig1Wt9x3rADfG8LANvMpw==" + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.1.tgz", + "integrity": "sha512-3mhfL+eNPG/woMNqwD/OHaW5qMpeGEBsDwzmhFmjB1yUV+M+M9P0NhP/AyHvnGz3DrqkvZ7CPzNMa+UkVLeELg==" }, "node_modules/@fontsource/roboto-mono": { "version": "4.5.0", @@ -20912,9 +20912,9 @@ "integrity": "sha512-8KTCsfs5m3UgICpHLglIKAS7vc2FFOu7/vvpWcE/42SWbh+9X8EJbEyJp6W96kU5iDVlAlUv4Cqc36Z9XUpLmA==" }, "@fontsource/roboto": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.0.tgz", - "integrity": "sha512-ja4XYw/9kNRFM5Ndk9vwzHWsdBMXczyBazFkTXJQ74QQBnT0BbSsHn0pF60AU0Iznig1Wt9x3rADfG8LANvMpw==" + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.1.tgz", + "integrity": "sha512-3mhfL+eNPG/woMNqwD/OHaW5qMpeGEBsDwzmhFmjB1yUV+M+M9P0NhP/AyHvnGz3DrqkvZ7CPzNMa+UkVLeELg==" }, "@fontsource/roboto-mono": { "version": "4.5.0", diff --git a/package.json b/package.json index 871f199..c749d6a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@chainlink/contracts": "^0.2.2", "@craco/craco": "^6.3.0", "@fontsource/fira-code": "^4.5.1", - "@fontsource/roboto": "^4.5.0", + "@fontsource/roboto": "^4.5.1", "@fontsource/roboto-mono": "^4.5.0", "@fontsource/space-grotesk": "^4.5.0", "@fortawesome/fontawesome-svg-core": "^1.2.36", From 5a72f28f3c6876f1b692c1d4e0d7a6625a80d1ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 20:12:40 +0000 Subject: [PATCH 25/31] Bump ethers from 5.4.6 to 5.4.7 (#70) --- package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index b2dc605..1123fd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", - "ethers": "^5.4.6", + "ethers": "^5.4.7", "highlightjs-solidity": "^1.2.0", "query-string": "^7.0.1", "react": "^17.0.2", @@ -1455,9 +1455,9 @@ } }, "node_modules/@ethersproject/bignumber": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.1.tgz", - "integrity": "sha512-fJhdxqoQNuDOk6epfM7yD6J8Pol4NUCy1vkaGAkuujZm0+lNow//MKu1hLhRiYV4BsOHyBv5/lsTjF+7hWwhJg==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.2.tgz", + "integrity": "sha512-oIBDhsKy5bs7j36JlaTzFgNPaZjiNDOXsdSgSpXRucUl+UA6L/1YLlFeI3cPAoodcenzF4nxNPV13pcy7XbWjA==", "funding": [ { "type": "individual", @@ -8120,9 +8120,9 @@ } }, "node_modules/ethers": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz", - "integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==", + "version": "5.4.7", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.7.tgz", + "integrity": "sha512-iZc5p2nqfWK1sj8RabwsPM28cr37Bpq7ehTQ5rWExBr2Y09Sn1lDKZOED26n+TsZMye7Y6mIgQ/1cwpSD8XZew==", "funding": [ { "type": "individual", @@ -8140,7 +8140,7 @@ "@ethersproject/address": "5.4.0", "@ethersproject/base64": "5.4.0", "@ethersproject/basex": "5.4.0", - "@ethersproject/bignumber": "5.4.1", + "@ethersproject/bignumber": "5.4.2", "@ethersproject/bytes": "5.4.0", "@ethersproject/constants": "5.4.0", "@ethersproject/contracts": "5.4.1", @@ -20602,9 +20602,9 @@ } }, "@ethersproject/bignumber": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.1.tgz", - "integrity": "sha512-fJhdxqoQNuDOk6epfM7yD6J8Pol4NUCy1vkaGAkuujZm0+lNow//MKu1hLhRiYV4BsOHyBv5/lsTjF+7hWwhJg==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.2.tgz", + "integrity": "sha512-oIBDhsKy5bs7j36JlaTzFgNPaZjiNDOXsdSgSpXRucUl+UA6L/1YLlFeI3cPAoodcenzF4nxNPV13pcy7XbWjA==", "requires": { "@ethersproject/bytes": "^5.4.0", "@ethersproject/logger": "^5.4.0", @@ -25036,9 +25036,9 @@ "version": "1.8.1" }, "ethers": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz", - "integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==", + "version": "5.4.7", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.7.tgz", + "integrity": "sha512-iZc5p2nqfWK1sj8RabwsPM28cr37Bpq7ehTQ5rWExBr2Y09Sn1lDKZOED26n+TsZMye7Y6mIgQ/1cwpSD8XZew==", "requires": { "@ethersproject/abi": "5.4.1", "@ethersproject/abstract-provider": "5.4.1", @@ -25046,7 +25046,7 @@ "@ethersproject/address": "5.4.0", "@ethersproject/base64": "5.4.0", "@ethersproject/basex": "5.4.0", - "@ethersproject/bignumber": "5.4.1", + "@ethersproject/bignumber": "5.4.2", "@ethersproject/bytes": "5.4.0", "@ethersproject/constants": "5.4.0", "@ethersproject/contracts": "5.4.1", diff --git a/package.json b/package.json index c749d6a..60d9bf2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/react-router-dom": "^5.3.0", "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", - "ethers": "^5.4.6", + "ethers": "^5.4.7", "highlightjs-solidity": "^1.2.0", "query-string": "^7.0.1", "react": "^17.0.2", From 46ba7c477e639f418b566b6e7b107c38a2845fb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Sep 2021 08:55:19 +0000 Subject: [PATCH 26/31] Bump highlightjs-solidity from 1.2.0 to 2.0.1 (#81) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1123fd1..fe3bba3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", "ethers": "^5.4.7", - "highlightjs-solidity": "^1.2.0", + "highlightjs-solidity": "^2.0.1", "query-string": "^7.0.1", "react": "^17.0.2", "react-blockies": "^1.4.1", @@ -9289,9 +9289,9 @@ } }, "node_modules/highlightjs-solidity": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-1.2.0.tgz", - "integrity": "sha512-KXYcVzBRof3CBWHsxGffsSEAJF0YsPaOk1jgIYv2xSzrBSxkfNUJFXrlE2oZEWvYQKbPqLe4qprJyNbSDV+LZA==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.1.tgz", + "integrity": "sha512-9YY+HQpXMTrF8HgRByjeQhd21GXAz2ktMPTcs6oWSj5HJR52fgsNoelMOmgigwcpt9j4tu4IVSaWaJB2n2TbvQ==" }, "node_modules/history": { "version": "4.10.1", @@ -25834,9 +25834,9 @@ "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" }, "highlightjs-solidity": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-1.2.0.tgz", - "integrity": "sha512-KXYcVzBRof3CBWHsxGffsSEAJF0YsPaOk1jgIYv2xSzrBSxkfNUJFXrlE2oZEWvYQKbPqLe4qprJyNbSDV+LZA==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.1.tgz", + "integrity": "sha512-9YY+HQpXMTrF8HgRByjeQhd21GXAz2ktMPTcs6oWSj5HJR52fgsNoelMOmgigwcpt9j4tu4IVSaWaJB2n2TbvQ==" }, "history": { "version": "4.10.1", diff --git a/package.json b/package.json index 60d9bf2..bf548ca 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@types/react-syntax-highlighter": "^13.5.2", "chart.js": "^3.5.1", "ethers": "^5.4.7", - "highlightjs-solidity": "^1.2.0", + "highlightjs-solidity": "^2.0.1", "query-string": "^7.0.1", "react": "^17.0.2", "react-blockies": "^1.4.1", From ba3d721e14359963eb49f45b590d7251880bb949 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 29 Sep 2021 16:22:35 -0300 Subject: [PATCH 27/31] Add devdoc params help to verified decoded input params --- src/Transaction.tsx | 2 + src/transaction/Details.tsx | 9 + src/transaction/decoder/DecodedParamRow.tsx | 161 +++++++++++------- .../decoder/DecodedParamsTable.tsx | 5 + src/useSourcify.ts | 31 +++- 5 files changed, 140 insertions(+), 68 deletions(-) diff --git a/src/Transaction.tsx b/src/Transaction.tsx index 29c7208..0edd994 100644 --- a/src/Transaction.tsx +++ b/src/Transaction.tsx @@ -82,6 +82,8 @@ const Transaction: React.FC = () => {
= ({ txData, txDesc, + userDoc, + devDoc, internalOps, sendsEthToMiner, ethUSDPrice, @@ -80,6 +85,8 @@ const Details: React.FC = ({ }, [txData, fourBytesEntry]); const resolvedTxDesc = txDesc ?? fourBytesTxDesc; + const userMethod = txDesc ? userDoc?.methods[txDesc.signature] : undefined; + const devMethod = txDesc ? devDoc?.methods[txDesc.signature] : undefined; return ( @@ -353,6 +360,8 @@ const Details: React.FC = ({ paramTypes={resolvedTxDesc.functionFragment.inputs} txData={txData} hasParamNames={resolvedTxDesc === txDesc} + userMethod={userMethod} + devMethod={devMethod} /> )} diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index 988e536..bd94dc4 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -1,5 +1,9 @@ -import React, { ReactNode } from "react"; +import React, { ReactNode, useState } from "react"; import { ParamType } from "@ethersproject/abi"; +import { Switch } from "@headlessui/react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faQuestionCircle } from "@fortawesome/free-regular-svg-icons/faQuestionCircle"; +import { faQuestionCircle as faQuestionCircleSolid } from "@fortawesome/free-solid-svg-icons/faQuestionCircle"; import Uint256Decoder from "./Uint256Decoder"; import AddressDecoder from "./AddressDecoder"; import BooleanDecoder from "./BooleanDecoder"; @@ -13,6 +17,7 @@ type DecodedParamRowProps = { paramType: ParamType; txData: TransactionData; arrayElem?: number | undefined; + help?: string | undefined; }; const DecodedParamRow: React.FC = ({ @@ -22,71 +27,95 @@ const DecodedParamRow: React.FC = ({ paramType, txData, arrayElem, -}) => ( - <> -
- - - - - {paramType.baseType === "tuple" && - r.map((e: any, idx: number) => ( - { + const [showHelp, setShowHelp] = useState(false); + + return ( + <> + + + + + + {paramType.baseType === "tuple" && + r.map((e: any, idx: number) => ( + param_{i}. + ) + } + i={idx} + r={e} + paramType={paramType.components[idx]} + txData={txData} + /> + ))} + {paramType.baseType === "array" && + r.map((e: any, idx: number) => ( + param_{i}} + r={e} + paramType={paramType.arrayChildren} + txData={txData} + arrayElem={idx} + /> + ))} + + ); +}; export default React.memo(DecodedParamRow); diff --git a/src/transaction/decoder/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx index 636dd67..f7daee5 100644 --- a/src/transaction/decoder/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -2,12 +2,15 @@ import React from "react"; import { ParamType, Result } from "@ethersproject/abi"; import DecodedParamRow from "./DecodedParamRow"; import { TransactionData } from "../../types"; +import { DevMethod, UserMethod } from "../../useSourcify"; type DecodedParamsTableProps = { args: Result; paramTypes: ParamType[]; txData: TransactionData; hasParamNames?: boolean; + userMethod?: UserMethod | undefined; + devMethod?: DevMethod | undefined; }; const DecodedParamsTable: React.FC = ({ @@ -15,6 +18,7 @@ const DecodedParamsTable: React.FC = ({ paramTypes, txData, hasParamNames = true, + devMethod, }) => (
@@ -23,6 +25,11 @@ const DecodedParamsTable: React.FC = ({ type value
Parameter names are not available.
{prefix && {prefix}} - {paramType.name ?? param_{i}}{" "} - {i !== undefined && ( - ({i}) + {arrayElem !== undefined ? ( + {" "} + [{arrayElem}] + + ) : ( + <> + {paramType.name ?? param_{i}}{" "} + {i !== undefined && ( + ({i}) + )} + )} {paramType.type} {prefix && {prefix}} {arrayElem !== undefined ? ( - {" "} + + {" "} [{arrayElem}] ) : ( diff --git a/src/transaction/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx similarity index 88% rename from src/transaction/DecodedParamsTable.tsx rename to src/transaction/decoder/DecodedParamsTable.tsx index 7cc0170..6f550f4 100644 --- a/src/transaction/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -1,7 +1,7 @@ import React from "react"; import { ParamType, Result } from "@ethersproject/abi"; import DecodedParamRow from "./DecodedParamRow"; -import { TransactionData } from "../types"; +import { TransactionData } from "../../types"; type DecodedParamsTableProps = { args: Result; @@ -27,7 +27,9 @@ const DecodedParamsTable: React.FC = ({
Parameter names are not available. + Parameter names are not available. +
- {prefix && {prefix}} - {arrayElem !== undefined ? ( - - {" "} - [{arrayElem}] - - ) : ( - <> - {paramType.name ?? param_{i}}{" "} - {i !== undefined && ( - ({i}) - )} - - )} - {paramType.type} - {paramType.baseType === "address" ? ( -
- - - - -
- ) : paramType.baseType === "bool" ? ( - - {r.toString()} - - ) : paramType.baseType === "bytes" ? ( - - {r.toString()}{" "} - - {r.toString().length / 2 - 1}{" "} - {r.toString().length / 2 - 1 === 1 ? "byte" : "bytes"} - - - ) : paramType.baseType === "tuple" || - paramType.baseType === "array" ? ( - <> - ) : ( - r.toString() - )} -
+ {prefix && {prefix}} + {arrayElem !== undefined ? ( + + {" "} + [{arrayElem}] + + ) : ( + <> + {paramType.name ?? param_{i}}{" "} + {i !== undefined && ( + ({i}) + )} + + )} + {paramType.type} + {paramType.baseType === "address" ? ( + + ) : paramType.baseType === "bool" ? ( + + ) : paramType.baseType === "bytes" ? ( + + ) : paramType.baseType === "tuple" || paramType.baseType === "array" ? ( + <> + ) : ( + r.toString() + )} +
{paramType.type} - {paramType.baseType === "address" ? ( + {paramType.baseType === "uint256" ? ( + + ) : paramType.baseType === "address" ? ( ) : paramType.baseType === "bool" ? ( diff --git a/src/transaction/decoder/Uint256Decoder.tsx b/src/transaction/decoder/Uint256Decoder.tsx new file mode 100644 index 0000000..65b50c1 --- /dev/null +++ b/src/transaction/decoder/Uint256Decoder.tsx @@ -0,0 +1,58 @@ +import React, { useState } from "react"; +import { hexlify } from "@ethersproject/bytes"; +import { commify, formatEther } from "@ethersproject/units"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faSync } from "@fortawesome/free-solid-svg-icons/faSync"; + +type Uint256DecoderProps = { + r: any; +}; + +enum DisplayMode { + RAW, + HEX, + EIGHTEEN_DECIMALS, +} + +const Uint256Decoder: React.FC = ({ r }) => { + const [displayMode, setDisplayMode] = useState( + DisplayMode.EIGHTEEN_DECIMALS + ); + + const toggleModes = () => { + setDisplayMode( + displayMode === DisplayMode.EIGHTEEN_DECIMALS ? 0 : displayMode + 1 + ); + }; + + return ( +
+ + + {displayMode === DisplayMode.RAW ? ( + <>{commify(r.toString())} + ) : displayMode === DisplayMode.HEX ? ( + <>{hexlify(r)} + ) : ( + <>{commify(formatEther(r))} + )} + +
+ ); +}; + +export default React.memo(Uint256Decoder); From 22b9c5b687a9f0ddf7977dac90eeb19f594a2aae Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 18:57:07 -0300 Subject: [PATCH 14/31] Small adjustments to toggling and formatting --- src/transaction/decoder/Uint256Decoder.tsx | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/transaction/decoder/Uint256Decoder.tsx b/src/transaction/decoder/Uint256Decoder.tsx index 65b50c1..7d4a003 100644 --- a/src/transaction/decoder/Uint256Decoder.tsx +++ b/src/transaction/decoder/Uint256Decoder.tsx @@ -1,5 +1,6 @@ import React, { useState } from "react"; -import { hexlify } from "@ethersproject/bytes"; +import { BigNumber } from "@ethersproject/bignumber"; +import { hexlify, hexZeroPad } from "@ethersproject/bytes"; import { commify, formatEther } from "@ethersproject/units"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faSync } from "@fortawesome/free-solid-svg-icons/faSync"; @@ -10,19 +11,29 @@ type Uint256DecoderProps = { enum DisplayMode { RAW, - HEX, EIGHTEEN_DECIMALS, + HEX, + _LAST, } +const VERY_BIG_NUMBER = BigNumber.from(10).pow(BigNumber.from(36)); + +const initDisplayMode = (r: any): DisplayMode => { + const n = BigNumber.from(r); + if (n.gte(VERY_BIG_NUMBER)) { + return DisplayMode.HEX; + } + return DisplayMode.RAW; +}; + const Uint256Decoder: React.FC = ({ r }) => { const [displayMode, setDisplayMode] = useState( - DisplayMode.EIGHTEEN_DECIMALS + initDisplayMode(r) ); const toggleModes = () => { - setDisplayMode( - displayMode === DisplayMode.EIGHTEEN_DECIMALS ? 0 : displayMode + 1 - ); + const next = displayMode + 1; + setDisplayMode(next === DisplayMode._LAST ? 0 : next); }; return ( @@ -36,17 +47,17 @@ const Uint256Decoder: React.FC = ({ r }) => { {displayMode === DisplayMode.RAW - ? "Raw number" + ? "Raw" : displayMode === DisplayMode.HEX - ? "Hex number" - : "18 decimals"} + ? "Hex" + : "18 dec"} {displayMode === DisplayMode.RAW ? ( <>{commify(r.toString())} ) : displayMode === DisplayMode.HEX ? ( - <>{hexlify(r)} + <>{hexZeroPad(hexlify(r), 32)} ) : ( <>{commify(formatEther(r))} )} From 9236bfcb2f98706fbb4c7b0c7c784d71580d3b96 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 19:37:14 -0300 Subject: [PATCH 15/31] Fix anonymous tuples --- src/transaction/decoder/DecodedParamRow.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index f0f0013..988e536 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -62,7 +62,14 @@ const DecodedParamRow: React.FC = ({ r.map((e: any, idx: number) => ( param_{i}. + ) + } + i={idx} r={e} paramType={paramType.components[idx]} txData={txData} From 9285d4dedff9b4aa7687b001866bb015fa84daf5 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 27 Sep 2021 00:49:23 -0300 Subject: [PATCH 16/31] Fix not known metadata scenario --- src/TokenTransferItem.tsx | 14 ++++++-------- src/transaction/Details.tsx | 2 +- src/types.ts | 4 +--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/TokenTransferItem.tsx b/src/TokenTransferItem.tsx index c9f40a2..083f7f0 100644 --- a/src/TokenTransferItem.tsx +++ b/src/TokenTransferItem.tsx @@ -7,7 +7,7 @@ import DecoratedAddressLink from "./components/DecoratedAddressLink"; import FormattedBalance from "./components/FormattedBalance"; import { AddressContext, - TokenMetas, + TokenMeta, TokenTransfer, TransactionData, } from "./types"; @@ -15,14 +15,14 @@ import { type TokenTransferItemProps = { t: TokenTransfer; txData: TransactionData; - tokenMetas: TokenMetas; + tokenMeta?: TokenMeta | undefined; }; // TODO: handle partial const TokenTransferItem: React.FC = ({ t, txData, - tokenMetas, + tokenMeta, }) => (
@@ -57,7 +57,7 @@ const TokenTransferItem: React.FC = ({ @@ -65,11 +65,9 @@ const TokenTransferItem: React.FC = ({
diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 5fb100a..dddfd75 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -206,7 +206,7 @@ const Details: React.FC = ({ key={i} t={t} txData={txData} - tokenMetas={txData.tokenMetas} + tokenMeta={txData.tokenMetas[t.token]} /> ))} diff --git a/src/types.ts b/src/types.ts index 5a5dad9..5904b31 100644 --- a/src/types.ts +++ b/src/types.ts @@ -108,6 +108,4 @@ export type TokenMeta = { decimals: number; }; -export type TokenMetas = { - [tokenAddress: string]: TokenMeta; -}; +export type TokenMetas = Record; From 78d3c0e1b7a3028bfc7bfdba3d6710b581fca38f Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 27 Sep 2021 01:09:56 -0300 Subject: [PATCH 17/31] Remove deprecated use4Bytes hook --- src/components/MethodName.tsx | 5 ++- src/transaction/Details.tsx | 4 +- src/use4Bytes.ts | 70 +---------------------------------- 3 files changed, 6 insertions(+), 73 deletions(-) diff --git a/src/components/MethodName.tsx b/src/components/MethodName.tsx index ff45cae..c965a81 100644 --- a/src/components/MethodName.tsx +++ b/src/components/MethodName.tsx @@ -7,8 +7,9 @@ type MethodNameProps = { const MethodName: React.FC = ({ data }) => { const rawFourBytes = rawInputTo4Bytes(data); - const methodName = use4Bytes(rawFourBytes); - const isSimpleTransfer = data === "0x"; + const fourBytesEntry = use4Bytes(rawFourBytes); + const methodName = fourBytesEntry?.name ?? rawFourBytes; + const isSimpleTransfer = rawFourBytes === "0x"; const methodTitle = isSimpleTransfer ? "ETH Transfer" : methodName === rawFourBytes diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index dddfd75..23f463a 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -36,7 +36,7 @@ import RelativePosition from "../components/RelativePosition"; import PercentagePosition from "../components/PercentagePosition"; import ModeTab from "../components/ModeTab"; import DecodedParamsTable from "./decoder/DecodedParamsTable"; -import { rawInputTo4Bytes, use4BytesFull } from "../use4Bytes"; +import { rawInputTo4Bytes, use4Bytes } from "../use4Bytes"; type DetailsProps = { txData: TransactionData; @@ -68,7 +68,7 @@ const Details: React.FC = ({ }, [txData]); const fourBytes = rawInputTo4Bytes(txData.data); - const fourBytesEntry = use4BytesFull(fourBytes); + const fourBytesEntry = use4Bytes(fourBytes); const fourBytesTxDesc = useMemo(() => { if (!txData || !fourBytesEntry?.signatureWithoutParamNames) { return undefined; diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index a1ab465..a494809 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -2,8 +2,6 @@ import { useState, useEffect, useContext } from "react"; import { RuntimeContext } from "./useRuntime"; import { fourBytesURL } from "./url"; -const cache = new Map(); - export type FourBytesEntry = { name: string; signatureWithoutParamNames: string | undefined; @@ -18,72 +16,6 @@ const simpleTransfer: FourBytesEntry = { const fullCache = new Map(); -// TODO: deprecate and remove -export const use4Bytes = (rawFourBytes: string) => { - const runtime = useContext(RuntimeContext); - const assetsURLPrefix = runtime.config?.assetsURLPrefix; - - const [name, setName] = useState(); - const [fourBytes, setFourBytes] = useState(); - useEffect(() => { - if (assetsURLPrefix === undefined || fourBytes === undefined) { - return; - } - - const signatureURL = fourBytesURL(assetsURLPrefix, fourBytes); - fetch(signatureURL) - .then(async (res) => { - if (!res.ok) { - console.error(`Signature does not exist in 4bytes DB: ${fourBytes}`); - - // Use the default 4 bytes as name - setName(rawFourBytes); - cache.set(fourBytes, null); - return; - } - - const sig = await res.text(); - const cut = sig.indexOf("("); - let method = sig.slice(0, cut); - method = method.charAt(0).toUpperCase() + method.slice(1); - setName(method); - cache.set(fourBytes, method); - return; - }) - .catch((err) => { - console.error(`Couldn't fetch signature URL ${signatureURL}`, err); - - // Use the default 4 bytes as name - setName(rawFourBytes); - }); - }, [rawFourBytes, assetsURLPrefix, fourBytes]); - - if (rawFourBytes === "0x") { - return "Transfer"; - } - if (assetsURLPrefix === undefined) { - return rawFourBytes; - } - - // Try to resolve 4bytes name - const entry = cache.get(rawFourBytes.slice(2)); - if (entry === null) { - return rawFourBytes; - } - if (entry !== undefined) { - // Simulates LRU - cache.delete(entry); - cache.set(rawFourBytes.slice(2), entry); - return entry; - } - if (name === undefined && fourBytes === undefined) { - setFourBytes(rawFourBytes.slice(2)); - return ""; - } - - return name; -}; - export const rawInputTo4Bytes = (rawInput: string) => rawInput.slice(0, 10); /** @@ -91,7 +23,7 @@ export const rawInputTo4Bytes = (rawInput: string) => rawInput.slice(0, 10); * * @param rawFourBytes an hex string containing the 4bytes signature in the "0xXXXXXXXX" format. */ -export const use4BytesFull = ( +export const use4Bytes = ( rawFourBytes: string ): FourBytesEntry | null | undefined => { if (rawFourBytes !== "0x") { From af95c04c9cf5abff04e5028d17b8f6f4d122cce3 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 27 Sep 2021 15:40:01 -0300 Subject: [PATCH 18/31] Flatten 4bytes signatures with param names --- Dockerfile | 8 ++++++-- nginx.conf | 34 ---------------------------------- package.json | 1 + src/use4Bytes.ts | 4 +++- 4 files changed, 10 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 223578a..af322ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,14 @@ WORKDIR /assets COPY trustwallet/blockchains/ethereum/assets /assets/ RUN find . -name logo.png | parallel magick convert {} -filter Lanczos -resize 32x32 {} +FROM alpine:3.14.0 AS fourbytesbuilder +WORKDIR /signatures +COPY 4bytes/signatures /signatures/ +COPY 4bytes/with_parameter_names /signatures/ + FROM nginx:1.21.1-alpine RUN apk add jq -COPY 4bytes/signatures /usr/share/nginx/html/signatures/ -COPY 4bytes/with_parameter_names /usr/share/nginx/html/with_parameter_names/ +COPY --from=fourbytesbuilder /signatures /usr/share/nginx/html/signatures/ COPY --from=logobuilder /assets /usr/share/nginx/html/assets/ COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /otterscan-build/build /usr/share/nginx/html/ diff --git a/nginx.conf b/nginx.conf index 8e55be6..55189ba 100644 --- a/nginx.conf +++ b/nginx.conf @@ -43,40 +43,6 @@ server { } } - location /with_parameter_names { - root /usr/share/nginx/html; - expires 30d; - - # Base on: https://michielkalkman.com/snippets/nginx-cors-open-configuration/ - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - # - # Om nom nom cookies - # - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - - # - # Tell client that this pre-flight info is valid for 20 days - # - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always; - } - } - location /assets { root /usr/share/nginx/html; expires 30d; diff --git a/package.json b/package.json index 96ba0b7..1cf8dfc 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "eject": "react-scripts eject", "source-map-explorer": "source-map-explorer build/static/js/*.js", "assets-start": "docker run --rm -p 3001:80 --name otterscan-assets -d -v$(pwd)/4bytes/signatures:/usr/share/nginx/html/signatures/ -v$(pwd)/trustwallet/blockchains/ethereum/assets:/usr/share/nginx/html/assets -v$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf nginx:1.21.1-alpine", + "assets-start-with-param-names": "docker run --rm -p 3001:80 --name otterscan-assets -d -v$(pwd)/4bytes/with_parameter_names:/usr/share/nginx/html/signatures/ -v$(pwd)/trustwallet/blockchains/ethereum/assets:/usr/share/nginx/html/assets -v$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf nginx:1.21.1-alpine", "assets-stop": "docker stop otterscan-assets", "docker-build": "DOCKER_BUILDKIT=1 docker build -t otterscan -f Dockerfile .", "docker-start": "docker run --rm -p 5000:80 --name otterscan -d otterscan", diff --git a/src/use4Bytes.ts b/src/use4Bytes.ts index a494809..622f327 100644 --- a/src/use4Bytes.ts +++ b/src/use4Bytes.ts @@ -59,7 +59,9 @@ export const use4Bytes = ( return; } - const sig = await res.text(); + // Get only the first occurrence, for now ignore alternative param names + const sigs = await res.text(); + const sig = sigs.split(";")[0]; const cut = sig.indexOf("("); let method = sig.slice(0, cut); method = method.charAt(0).toUpperCase() + method.slice(1); From debc046d83ad5bf9a789216939dc55d6e8cbeb3f Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Mon, 27 Sep 2021 15:47:55 -0300 Subject: [PATCH 19/31] Remove unused attribute; custom param presence msg depending on signature with or without param names --- src/transaction/Details.tsx | 4 ++-- src/transaction/decoder/DecodedParamsTable.tsx | 4 +++- src/use4Bytes.ts | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 23f463a..bfd8747 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -70,10 +70,10 @@ const Details: React.FC = ({ const fourBytes = rawInputTo4Bytes(txData.data); const fourBytesEntry = use4Bytes(fourBytes); const fourBytesTxDesc = useMemo(() => { - if (!txData || !fourBytesEntry?.signatureWithoutParamNames) { + if (!txData || !fourBytesEntry?.signature) { return undefined; } - const sig = fourBytesEntry?.signatureWithoutParamNames; + const sig = fourBytesEntry?.signature; const functionFragment = Fragment.fromString(`function ${sig}`); const intf = new Interface([functionFragment]); return intf.parseTransaction({ data: txData.data, value: txData.value }); diff --git a/src/transaction/decoder/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx index 6f550f4..636dd67 100644 --- a/src/transaction/decoder/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -28,7 +28,9 @@ const DecodedParamsTable: React.FC = ({ {!hasParamNames && (
- Parameter names are not available. + {paramTypes.length > 0 && paramTypes[0].name !== null + ? "Parameter names are estimated." + : "Parameter names are not available."}
- {prefix && {prefix}} - {arrayElem !== undefined ? ( - - {" "} - [{arrayElem}] - - ) : ( - <> - {paramType.name ?? param_{i}}{" "} - {i !== undefined && ( - ({i}) - )} - - )} - {paramType.type} - {paramType.baseType === "uint256" ? ( - - ) : paramType.baseType === "address" ? ( - - ) : paramType.baseType === "bool" ? ( - - ) : paramType.baseType === "bytes" ? ( - - ) : paramType.baseType === "tuple" || paramType.baseType === "array" ? ( - <> - ) : ( - r.toString() - )} -
+
+ {prefix && {prefix}} + {arrayElem !== undefined ? ( + + {" "} + [{arrayElem}] + ) : ( - param_{i}. - ) - } - i={idx} - r={e} - paramType={paramType.components[idx]} - txData={txData} - /> - ))} - {paramType.baseType === "array" && - r.map((e: any, idx: number) => ( - param_{i}} - r={e} - paramType={paramType.arrayChildren} - txData={txData} - arrayElem={idx} - /> - ))} - -); + <> + {paramType.name ?? param_{i}}{" "} + {i !== undefined && ( + ({i}) + )} + + )} + {help && ( + <> + {" "} + + + + + )} +
+ {help && showHelp &&
{help}
} +
{paramType.type} + {paramType.baseType === "uint256" ? ( + + ) : paramType.baseType === "address" ? ( + + ) : paramType.baseType === "bool" ? ( + + ) : paramType.baseType === "bytes" ? ( + + ) : paramType.baseType === "tuple" || + paramType.baseType === "array" ? ( + <> + ) : ( + r.toString() + )} +
@@ -43,6 +47,7 @@ const DecodedParamsTable: React.FC = ({ r={r} paramType={paramTypes[i]} txData={txData} + help={devMethod?.params?.[paramTypes[i].name]} /> ))} diff --git a/src/useSourcify.ts b/src/useSourcify.ts index b60fde9..0d6ea59 100644 --- a/src/useSourcify.ts +++ b/src/useSourcify.ts @@ -3,6 +3,33 @@ import { Interface } from "@ethersproject/abi"; import { TransactionData } from "./types"; import { sourcifyMetadata, SourcifySource, sourcifySourceFile } from "./url"; +export type UserMethod = { + notice?: string | undefined; +}; + +export type UserEvent = { + notice?: string | undefined; +}; + +export type UserDoc = { + kind: "user"; + version?: number | undefined; + notice?: string | undefined; + methods: Record; + events: Record; +}; + +export type DevMethod = { + params?: Record; + returns?: Record; +}; + +export type DevDoc = { + kind: "dev"; + version?: number | undefined; + methods: Record; +}; + export type Metadata = { version: string; language: string; @@ -33,8 +60,8 @@ export type Metadata = { }; output: { abi: any[]; - userdocs: any[]; - devdoc: any[]; + userdoc?: UserDoc | undefined; + devdoc?: DevDoc | undefined; }; }; From b770de3117d4c2a19a76cd0c62d30ccab1876fd7 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 29 Sep 2021 16:27:36 -0300 Subject: [PATCH 28/31] Tune spacing --- src/transaction/decoder/DecodedParamRow.tsx | 55 ++++++++++----------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index bd94dc4..fed9ecb 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -35,35 +35,34 @@ const DecodedParamRow: React.FC = ({ <>
-
- {prefix && {prefix}} - {arrayElem !== undefined ? ( - - {" "} - [{arrayElem}] - - ) : ( - <> - {paramType.name ?? param_{i}}{" "} - {i !== undefined && ( - ({i}) - )} - - )} +
+ + {prefix && {prefix}} + {arrayElem !== undefined ? ( + + {" "} + [{arrayElem}] + + ) : ( + <> + {paramType.name ?? param_{i}}{" "} + {i !== undefined && ( + ({i}) + )} + + )} + {help && ( - <> - {" "} - - - - + + + )}
{help && showHelp &&
{help}
} From 7b8dd7d1594f2d0c81bc75e8b15bc8038ac1b071 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Wed, 29 Sep 2021 16:34:49 -0300 Subject: [PATCH 29/31] Lower log level --- src/transaction/Details.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 8cad060..716c529 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -66,8 +66,8 @@ const Details: React.FC = ({ try { return txData && toUtf8String(txData.data); } catch (err) { - console.error("Error while converting input data to string"); - console.error(err); + console.warn("Error while converting input data to string"); + console.warn(err); return ""; } }, [txData]); From 11c2cf972382a9bb65bbe7b6923c5a3f3f30f881 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Fri, 1 Oct 2021 15:38:46 -0300 Subject: [PATCH 30/31] Update browserslist --- package-lock.json | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe3bba3..081eeb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5563,8 +5563,13 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001191", - "license": "CC-BY-4.0" + "version": "1.0.30001263", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001263.tgz", + "integrity": "sha512-doiV5dft6yzWO1WwU19kt8Qz8R0/8DgEziz6/9n2FxUasteZNwNNYSmJO3GLBH8lCVE73AB1RPDPAeYbcO5Cvw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } }, "node_modules/capture-exit": { "version": "2.0.0", @@ -23357,7 +23362,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001191" + "version": "1.0.30001263", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001263.tgz", + "integrity": "sha512-doiV5dft6yzWO1WwU19kt8Qz8R0/8DgEziz6/9n2FxUasteZNwNNYSmJO3GLBH8lCVE73AB1RPDPAeYbcO5Cvw==" }, "capture-exit": { "version": "2.0.0", From 00ecbee8e2e5562d12ac030678f60b77d72d3a1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Oct 2021 18:39:17 +0000 Subject: [PATCH 31/31] Bump @types/react from 17.0.24 to 17.0.26 (#82) --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 081eeb0..495f958 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", "@types/node": "^14.17.5", - "@types/react": "^17.0.24", + "@types/react": "^17.0.26", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.4", @@ -3090,9 +3090,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.24.tgz", - "integrity": "sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg==", + "version": "17.0.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.26.tgz", + "integrity": "sha512-MXxuXrH2xOcv5cp/su4oz69dNQnSA90JjFw5HBd5wifw6Ihi94j7dRJm7qNsB30tnruXSCPc9qmlhGop4nh9Hw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -21619,9 +21619,9 @@ "version": "1.5.4" }, "@types/react": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.24.tgz", - "integrity": "sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg==", + "version": "17.0.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.26.tgz", + "integrity": "sha512-MXxuXrH2xOcv5cp/su4oz69dNQnSA90JjFw5HBd5wifw6Ihi94j7dRJm7qNsB30tnruXSCPc9qmlhGop4nh9Hw==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", diff --git a/package.json b/package.json index bf548ca..ad60da8 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", "@types/node": "^14.17.5", - "@types/react": "^17.0.24", + "@types/react": "^17.0.26", "@types/react-blockies": "^1.4.1", "@types/react-dom": "^17.0.9", "@types/react-highlight": "^0.12.4",