diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx index 58229d3a9d2..c4e934075ff 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/create-token-page-impl.tsx @@ -21,10 +21,12 @@ import { deployERC20Contract } from "thirdweb/deploys"; import type { ClaimConditionsInput } from "thirdweb/dist/types/utils/extensions/drops/types"; import { claimTo, + getActiveClaimCondition, setClaimConditions as setClaimConditionsExtension, transferBatch, } from "thirdweb/extensions/erc20"; import { useActiveAccount } from "thirdweb/react"; +import { pollWithTimeout } from "../../../../../../../../utils/pollWithTimeout"; import { useAddContractToProject } from "../../hooks/project-contracts"; import { CreateTokenAssetPageUI } from "./create-token-page.client"; import type { CreateAssetFormValues } from "./form"; @@ -241,6 +243,17 @@ export function CreateTokenAssetPage(props: { chain, }); + // poll until claim conditions are set before moving on to minting + await pollWithTimeout({ + shouldStop: async () => { + const claimConditions = await getActiveClaimCondition({ + contract, + }); + return !!claimConditions; + }, + timeoutMs: 30000, + }); + const totalSupply = Number(formValues.supply); const salePercent = formValues.saleEnabled ? Number(formValues.saleAllocationPercentage)