Skip to content

Commit f6ebd54

Browse files
committed
Merge branch 'main' into greg/tool-4864-handle-sponsored-gas-in-new-widgets
2 parents 277c2e2 + d7a0613 commit f6ebd54

File tree

62 files changed

+643
-589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+643
-589
lines changed

.changeset/crazy-bushes-stick.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"tiny-invariant": "^1.3.3",
8282
"use-debounce": "^10.0.5",
8383
"vaul": "^1.1.2",
84-
"zod": "3.25.62"
84+
"zod": "3.25.67"
8585
},
8686
"devDependencies": {
8787
"@biomejs/biome": "2.0.4",

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/NextSteps.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/ClaimChainSection.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/page.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
33
import { getRawAccount } from "../../../../account/settings/getAccount";
44
import { getChain, getChainMetadata } from "../../utils";
55
import { BuyFundsSection } from "./components/client/BuyFundsSection";
6-
import NextSteps from "./components/client/NextSteps";
76
import { ChainOverviewSection } from "./components/server/ChainOverviewSection";
8-
import { ClaimChainSection } from "./components/server/ClaimChainSection";
97
import { ChainCTA } from "./components/server/cta-card";
108
import { ExplorersSection } from "./components/server/explorer-section";
119
import { FaucetSection } from "./components/server/FaucetSection";
@@ -60,11 +58,6 @@ export default async function Page(props: {
6058
{chain.services.filter((s) => s.enabled).length > 0 && (
6159
<SupportedProductsSection services={chain.services} />
6260
)}
63-
{/*Next Steps */}
64-
<NextSteps chain={chain} />
65-
66-
{/* Claim Chain */}
67-
{!chainMetadata && <ClaimChainSection />}
6861
</div>
6962
);
7063
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { ThirdwebContract } from "thirdweb";
2+
import { isOwnerSupported, owner } from "thirdweb/extensions/common";
3+
import {
4+
getRoleMember,
5+
isGetRoleAdminSupported,
6+
} from "thirdweb/extensions/permissions";
7+
8+
export async function getContractCreator(
9+
contract: ThirdwebContract,
10+
functionSelectors: string[],
11+
) {
12+
if (isOwnerSupported(functionSelectors)) {
13+
return owner({
14+
contract,
15+
});
16+
}
17+
18+
if (isGetRoleAdminSupported(functionSelectors)) {
19+
return getRoleMember({
20+
contract,
21+
index: BigInt(0),
22+
role: "admin",
23+
});
24+
}
25+
26+
return null;
27+
}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/supply-claimed-progress.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Meta, StoryObj } from "@storybook/nextjs";
2-
import { maxUint256 } from "thirdweb/utils";
3-
import { BadgeContainer } from "../../../../../../../../@/storybook/utils";
2+
import { BadgeContainer } from "@/storybook/utils";
43
import { SupplyClaimedProgress } from "./supply-claimed-progress";
54

65
const meta = {
@@ -19,7 +18,7 @@ function StoryVariants() {
1918
return (
2019
<div className="container max-w-md space-y-10 py-10">
2120
<BadgeContainer label="10 / Unlimited Supply">
22-
<SupplyClaimedProgress claimedSupply={10n} totalSupply={maxUint256} />
21+
<SupplyClaimedProgress claimedSupply={10n} totalSupply="unlimited" />
2322
</BadgeContainer>
2423

2524
<BadgeContainer label="500/1000 Supply">

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/_components/supply-claimed-progress.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { InfinityIcon } from "lucide-react";
2-
import { maxUint256 } from "thirdweb/utils";
32
import { Progress } from "@/components/ui/progress";
43
import { supplyFormatter } from "../nft/format";
54

65
export function SupplyClaimedProgress(props: {
76
claimedSupply: bigint;
8-
totalSupply: bigint;
7+
totalSupply: bigint | "unlimited";
98
}) {
109
// if total supply is unlimited
11-
if (props.totalSupply === maxUint256) {
10+
if (props.totalSupply === "unlimited") {
1211
return (
1312
<p className="flex items-center justify-between gap-2">
1413
<span className="font-medium text-sm">Claimed Supply </span>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { ThirdwebContract } from "thirdweb";
2+
import { WalletAddress } from "@/components/blocks/wallet-address";
3+
4+
export function ContractCreatorBadge(props: {
5+
contractCreator: string;
6+
clientContract: ThirdwebContract;
7+
}) {
8+
return (
9+
<div className="flex items-center gap-1.5 bg-card rounded-full px-2.5 py-1.5 border hover:bg-accent">
10+
<span className="text-xs text-foreground">By</span>
11+
<WalletAddress
12+
address={props.contractCreator}
13+
className="py-0 text-xs h-auto !no-underline"
14+
client={props.clientContract.client}
15+
iconClassName="size-3.5 hidden"
16+
/>
17+
</div>
18+
);
19+
}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/ContractHeader.stories.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ export const WithImageAndMultipleSocialUrls: Story = {
8888
args: {
8989
chainMetadata: ethereumChainMetadata,
9090
clientContract: mockContract,
91+
contractCreator: null,
92+
image: mockTokenImage,
93+
name: "Sample Token",
94+
socialUrls: {
95+
discord: mockSocialUrls.discord,
96+
github: mockSocialUrls.github,
97+
telegram: mockSocialUrls.telegram,
98+
twitter: mockSocialUrls.twitter,
99+
website: mockSocialUrls.website,
100+
},
101+
symbol: "SMPL",
102+
},
103+
};
104+
105+
export const WithContractCreator: Story = {
106+
args: {
107+
chainMetadata: ethereumChainMetadata,
108+
clientContract: mockContract,
109+
contractCreator: "0x1234567890123456789012345678901234567890",
91110
image: mockTokenImage,
92111
name: "Sample Token",
93112
socialUrls: {
@@ -105,6 +124,7 @@ export const WithBrokenImageAndSingleSocialUrl: Story = {
105124
args: {
106125
chainMetadata: ethereumChainMetadata,
107126
clientContract: mockContract,
127+
contractCreator: null,
108128
image: "broken-image.png",
109129
name: "Sample Token",
110130
socialUrls: {
@@ -118,6 +138,7 @@ export const WithoutImageAndNoSocialUrls: Story = {
118138
args: {
119139
chainMetadata: ethereumChainMetadata,
120140
clientContract: mockContract,
141+
contractCreator: null,
121142
image: undefined,
122143
name: "Sample Token",
123144
socialUrls: {},
@@ -129,6 +150,7 @@ export const LongNameAndLotsOfSocialUrls: Story = {
129150
args: {
130151
chainMetadata: ethereumChainMetadata,
131152
clientContract: mockContract,
153+
contractCreator: null,
132154
image: "https://thirdweb.com/chain-icons/ethereum.svg",
133155
name: "This is a very long token name that should wrap to multiple lines",
134156
socialUrls: {
@@ -148,6 +170,7 @@ export const AllSocialUrls: Story = {
148170
args: {
149171
chainMetadata: ethereumChainMetadata,
150172
clientContract: mockContract,
173+
contractCreator: null,
151174
image: "https://thirdweb.com/chain-icons/ethereum.svg",
152175
name: "Sample Token",
153176
socialUrls: {
@@ -171,6 +194,7 @@ export const InvalidSocialUrls: Story = {
171194
args: {
172195
chainMetadata: ethereumChainMetadata,
173196
clientContract: mockContract,
197+
contractCreator: null,
174198
image: "https://thirdweb.com/chain-icons/ethereum.svg",
175199
name: "Sample Token",
176200
socialUrls: {
@@ -188,6 +212,7 @@ export const SomeSocialUrls: Story = {
188212
args: {
189213
chainMetadata: ethereumChainMetadata,
190214
clientContract: mockContract,
215+
contractCreator: null,
191216
image: "https://thirdweb.com/chain-icons/ethereum.svg",
192217
name: "Sample Token",
193218
socialUrls: {

0 commit comments

Comments
 (0)