Skip to content

Commit d570796

Browse files
clickable contract
1 parent b964fc1 commit d570796

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type AbiItem =
2424
};
2525

2626
export type DecodedTransactionData = {
27+
chainId: number;
28+
contractAddress: string;
2729
contractName: string;
2830
functionName: string;
2931
functionArgs: Record<string, unknown>;
@@ -105,6 +107,8 @@ async function decodeSingleTransactionParam(
105107
}
106108

107109
return {
110+
chainId,
111+
contractAddress: txParam.to,
108112
contractName,
109113
functionArgs,
110114
functionName,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/transaction-details-ui.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import Link from "next/link";
1111
import { useState } from "react";
1212
import { hexToNumber, isHex, type ThirdwebClient, toEther } from "thirdweb";
13-
import { stringify } from "thirdweb/utils";
13+
import { stringify,shortenAddress } from "thirdweb/utils";
1414
import type { Project } from "@/api/projects";
1515
import { WalletAddress } from "@/components/blocks/wallet-address";
1616
import { Badge } from "@/components/ui/badge";
@@ -509,7 +509,11 @@ function DecodedTransactionDisplay({
509509
</div>
510510
<div className="flex flex-col flex-1">
511511
<div className="text-muted-foreground text-sm">Contract</div>
512-
<div className="font-mono text-sm">{decodedData.contractName}</div>
512+
<div className="font-mono text-sm">
513+
<Link href={`/${decodedData.chainId}/${decodedData.contractAddress}`} target="_blank" className="underline">
514+
{decodedData.contractName}
515+
</Link>
516+
</div>
513517
</div>
514518
</div>
515519
<div>

0 commit comments

Comments
 (0)