Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/dashboard/src/app/drops/[slug]/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Metadata } from "next";
import type { GaslessOptions } from "thirdweb/transaction";

type DropPageData = {
slug: string;
Expand All @@ -9,6 +10,7 @@ type DropPageData = {
// If not defined, we will use the image of the NFT or contract's image
thumbnail?: string;
metadata: Metadata;
gasless?: GaslessOptions;
} & ({ type: "erc1155"; tokenId: bigint } | { type: "erc721" });

export const DROP_PAGES: DropPageData[] = [
Expand Down Expand Up @@ -45,6 +47,12 @@ export const DROP_PAGES: DropPageData[] = [
"This exclusive commemorative NFT marks the official launch of ZERϴ's mainnet and our exciting partnership with thirdweb. Own a piece of this milestone in blockchain history as we make onchain transactions free with zero.network",
},
},
gasless: {
provider: "engine",
relayerForwarderAddress: "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty relayerForwarderAddress will prevent gasless transactions from working correctly. This field requires a valid contract address for the forwarder on the target network. Consider adding a network-specific forwarder address or removing the gasless configuration until the correct address is available.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

relayerUrl:
"https://thirdweb.engine-usw2.thirdweb.com/relayer/790e2b34-a35d-4526-9396-f2163eb6e3a5",
},
},

// Add more chains here
Expand Down
7 changes: 7 additions & 0 deletions apps/dashboard/src/app/drops/[slug]/mint-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
useActiveAccount,
useReadContract,
} from "thirdweb/react";
import type { GaslessOptions } from "thirdweb/transaction";

type Props = {
contract: ThirdwebContract;
Expand All @@ -36,6 +37,7 @@ type Props = {
currencySymbol: string | null;
noActiveClaimCondition: false;
quantityLimitPerWallet: bigint;
gasless?: GaslessOptions;
}
| { noActiveClaimCondition: true }
);
Expand Down Expand Up @@ -181,6 +183,11 @@ export function NftMint(props: Props) {
contractAddress={props.contract.address}
chain={props.contract.chain}
client={props.contract.client}
gasless={
props.noActiveClaimCondition === false
? props.gasless
: undefined
}
claimParams={
props.type === "erc1155"
? {
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/src/app/drops/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export default async function DropPage({
pricePerToken={pricePerToken}
noActiveClaimCondition={false}
quantityLimitPerWallet={claimCondition.quantityLimitPerWallet}
gasless={project.gasless}
{...project}
/>
);
Expand Down
Loading