diff --git a/apps/dashboard/src/components/contract-functions/contract-function.tsx b/apps/dashboard/src/components/contract-functions/contract-function.tsx index 0c773a3749e..c87efc631ea 100644 --- a/apps/dashboard/src/components/contract-functions/contract-function.tsx +++ b/apps/dashboard/src/components/contract-functions/contract-function.tsx @@ -1,5 +1,7 @@ "use client"; +import { CopyTextButton } from "@/components/ui/CopyTextButton"; +import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; import { useDashboardRouter } from "@/lib/DashboardRouter"; import { cn } from "@/lib/utils"; @@ -34,7 +36,7 @@ import * as ERC721Ext from "thirdweb/extensions/erc721"; import * as ERC1155Ext from "thirdweb/extensions/erc1155"; import { useReadContract } from "thirdweb/react"; import { toFunctionSelector } from "thirdweb/utils"; -import { Badge, Button, Card, Heading, Text } from "tw-components"; +import { Button, Card, Heading, Text } from "tw-components"; import { useDebounce } from "use-debounce"; import { useContractFunctionSelectors } from "../../contract-ui/hooks/useContractFunctionSelectors"; import { @@ -85,6 +87,11 @@ function ContractFunctionInner({ contract, fn }: ContractFunctionProps) { return undefined; }, [isERC20, isERC721Query.data, isERC1155Query.data]); + const functionSelector = useMemo( + () => (fn?.type === "function" ? toFunctionSelector(fn) : undefined), + [fn], + ); + if (!fn) { return null; } @@ -111,21 +118,22 @@ function ContractFunctionInner({ contract, fn }: ContractFunctionProps) { return ( - + {camelToTitle(fn.name)} ({fn.name}) - {isFunction && ( - - {fn.stateMutability} - + {isFunction && {fn.stateMutability}} + {functionSelector && ( + )} @@ -173,11 +181,7 @@ function ContractFunctionInputs(props: { ({fn.name}) - {isFunction && ( - - {fn.stateMutability} - - )} + {isFunction && {fn.stateMutability}} {fn.inputs?.length ? ( diff --git a/apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx b/apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx index 1df149ecaaa..241e44797ff 100644 --- a/apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx +++ b/apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx @@ -1,5 +1,6 @@ "use client"; +import { Badge } from "@/components/ui/badge"; import { InlineCode } from "@/components/ui/inline-code"; import { ToolTipLabel } from "@/components/ui/tooltip"; import { @@ -416,7 +417,15 @@ export const InteractiveAbiFunction: React.FC = ({ ) : formattedResponseData ? ( <> - Output +
+ Output + {/* Show the Solidity type of the function's output */} + {abiFunction.outputs.length > 0 && ( + + {abiFunction.outputs[0]?.type} + + )} +