diff --git a/package-lock.json b/package-lock.json index ef51571..ce287b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.1.16", "@headlessui/react": "^1.4.1", - "@testing-library/jest-dom": "^5.14.1", + "@testing-library/jest-dom": "^5.15.0", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", @@ -2887,9 +2887,9 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.14.1.tgz", - "integrity": "sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.15.0.tgz", + "integrity": "sha512-lOMuQidnL1tWHLEWIhL6UvSZC1Qt3OkNe1khvi2h6xFiqpe5O8arYs46OU0qyUGq0cSTbroQyMktYNXu3a7sAA==", "dependencies": { "@babel/runtime": "^7.9.2", "@types/testing-library__jest-dom": "^5.9.1", @@ -21609,9 +21609,9 @@ } }, "@testing-library/jest-dom": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.14.1.tgz", - "integrity": "sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.15.0.tgz", + "integrity": "sha512-lOMuQidnL1tWHLEWIhL6UvSZC1Qt3OkNe1khvi2h6xFiqpe5O8arYs46OU0qyUGq0cSTbroQyMktYNXu3a7sAA==", "requires": { "@babel/runtime": "^7.9.2", "@types/testing-library__jest-dom": "^5.9.1", diff --git a/package.json b/package.json index d301e67..ab9241d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.1.16", "@headlessui/react": "^1.4.1", - "@testing-library/jest-dom": "^5.14.1", + "@testing-library/jest-dom": "^5.15.0", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.24", diff --git a/src/TokenTransferItem.tsx b/src/TokenTransferItem.tsx index 2131766..320c984 100644 --- a/src/TokenTransferItem.tsx +++ b/src/TokenTransferItem.tsx @@ -40,6 +40,7 @@ const TokenTransferItem: React.FC = ({ addressCtx={AddressContext.FROM} txFrom={t.from === txData.from} txTo={t.from === txData.to} + resolvedAddresses={resolvedAddresses} /> @@ -51,6 +52,7 @@ const TokenTransferItem: React.FC = ({ addressCtx={AddressContext.TO} txFrom={t.to === txData.from} txTo={t.to === txData.to} + resolvedAddresses={resolvedAddresses} /> diff --git a/src/api/address-resolver/hardcoded-addresses/1.json b/src/api/address-resolver/hardcoded-addresses/1.json index 7ae2f9b..072a2c0 100644 --- a/src/api/address-resolver/hardcoded-addresses/1.json +++ b/src/api/address-resolver/hardcoded-addresses/1.json @@ -1,5 +1,9 @@ { "0x7d655c57f71464B6f83811C55D84009Cd9f5221C": "Gitcoin: Bulk Checkout", + "0xf2354570bE2fB420832Fb7Ff6ff0AE0dF80CF2c6": "Gitcoin: GR8 Matching Payout", + "0x3342E3737732D879743f2682A3953a730ae4F47C": "Gitcoin: GR9 Matching Payout", + "0x3ebAFfe01513164e638480404c651E885cCA0AA4": "Gitcoin: GR10 Matching Payout", + "0x0EbD2E2130b73107d0C45fF2E16c93E7e2e10e3a": "Gitcoin: GR11 Matching Payout", "0x722122dF12D4e14e13Ac3b6895a86e84145b6967": "Tornado Cash: Proxy", "0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95": "Uniswap V1: Factory", "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f": "Uniswap V2: Factory", diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 9c9e29d..85cb2fc 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -375,6 +375,7 @@ const Details: React.FC = ({ hasParamNames={resolvedTxDesc === txDesc} userMethod={userMethod} devMethod={devMethod} + resolvedAddresses={resolvedAddresses} /> )} diff --git a/src/transaction/LogEntry.tsx b/src/transaction/LogEntry.tsx index 2993e16..4e89ffd 100644 --- a/src/transaction/LogEntry.tsx +++ b/src/transaction/LogEntry.tsx @@ -114,6 +114,7 @@ const LogEntry: React.FC = ({ paramTypes={resolvedLogDesc.eventFragment.inputs} txData={txData} hasParamNames={resolvedLogDesc === logDesc} + resolvedAddresses={resolvedAddresses} /> diff --git a/src/transaction/decoder/AddressDecoder.tsx b/src/transaction/decoder/AddressDecoder.tsx index ee6369a..45fb30c 100644 --- a/src/transaction/decoder/AddressDecoder.tsx +++ b/src/transaction/decoder/AddressDecoder.tsx @@ -3,13 +3,19 @@ import AddressHighlighter from "../../components/AddressHighlighter"; import DecoratedAddressLink from "../../components/DecoratedAddressLink"; import Copy from "../../components/Copy"; import { TransactionData } from "../../types"; +import { ResolvedAddresses } from "../../api/address-resolver"; type AddressDecoderProps = { r: any; txData: TransactionData; + resolvedAddresses?: ResolvedAddresses | undefined; }; -const AddressDecoder: React.FC = ({ r, txData }) => ( +const AddressDecoder: React.FC = ({ + r, + txData, + resolvedAddresses, +}) => (
= ({ r, txData }) => ( miner={r.toString() === txData.confirmedData?.miner} txFrom={r.toString() === txData.from} txTo={r.toString() === txData.to} + resolvedAddresses={resolvedAddresses} /> diff --git a/src/transaction/decoder/DecodedParamRow.tsx b/src/transaction/decoder/DecodedParamRow.tsx index fed9ecb..b2b0baf 100644 --- a/src/transaction/decoder/DecodedParamRow.tsx +++ b/src/transaction/decoder/DecodedParamRow.tsx @@ -9,6 +9,7 @@ import AddressDecoder from "./AddressDecoder"; import BooleanDecoder from "./BooleanDecoder"; import BytesDecoder from "./BytesDecoder"; import { TransactionData } from "../../types"; +import { ResolvedAddresses } from "../../api/address-resolver"; type DecodedParamRowProps = { prefix?: ReactNode; @@ -18,6 +19,7 @@ type DecodedParamRowProps = { txData: TransactionData; arrayElem?: number | undefined; help?: string | undefined; + resolvedAddresses?: ResolvedAddresses | undefined; }; const DecodedParamRow: React.FC = ({ @@ -28,6 +30,7 @@ const DecodedParamRow: React.FC = ({ txData, arrayElem, help, + resolvedAddresses, }) => { const [showHelp, setShowHelp] = useState(false); @@ -72,7 +75,11 @@ const DecodedParamRow: React.FC = ({ {paramType.baseType === "uint256" ? ( ) : paramType.baseType === "address" ? ( - + ) : paramType.baseType === "bool" ? ( ) : paramType.baseType === "bytes" ? ( diff --git a/src/transaction/decoder/DecodedParamsTable.tsx b/src/transaction/decoder/DecodedParamsTable.tsx index f7daee5..8f4a562 100644 --- a/src/transaction/decoder/DecodedParamsTable.tsx +++ b/src/transaction/decoder/DecodedParamsTable.tsx @@ -3,6 +3,7 @@ import { ParamType, Result } from "@ethersproject/abi"; import DecodedParamRow from "./DecodedParamRow"; import { TransactionData } from "../../types"; import { DevMethod, UserMethod } from "../../useSourcify"; +import { ResolvedAddresses } from "../../api/address-resolver"; type DecodedParamsTableProps = { args: Result; @@ -11,6 +12,7 @@ type DecodedParamsTableProps = { hasParamNames?: boolean; userMethod?: UserMethod | undefined; devMethod?: DevMethod | undefined; + resolvedAddresses?: ResolvedAddresses | undefined; }; const DecodedParamsTable: React.FC = ({ @@ -19,6 +21,7 @@ const DecodedParamsTable: React.FC = ({ txData, hasParamNames = true, devMethod, + resolvedAddresses, }) => ( @@ -48,6 +51,7 @@ const DecodedParamsTable: React.FC = ({ paramType={paramTypes[i]} txData={txData} help={devMethod?.params?.[paramTypes[i].name]} + resolvedAddresses={resolvedAddresses} /> ))}