diff --git a/.env.example b/.env.example index a0d59a3..997ce4f 100644 --- a/.env.example +++ b/.env.example @@ -16,7 +16,7 @@ NEXT_PUBLIC_VENDING_FACTORY_ADDRESS="stars18h7ugh8eaug7wr0w4yjw0ls5s937z35pnkg93 NEXT_PUBLIC_FEATURED_VENDING_FACTORY_ADDRESS="stars14pd96yk3t6gq9l6uyrkg0n5dr09n8rt5y9v3at8x4wl4lrkxhlzq4trqmh" NEXT_PUBLIC_VENDING_FACTORY_UPDATABLE_ADDRESS="stars1h65nms9gwg4vdktyqj84tu50gwlm34e0eczl5w2ezllxuzfxy9esa9qlt0" NEXT_PUBLIC_VENDING_FACTORY_FLEX_ADDRESS="stars1hvu2ghqkcnvhtj2fc6wuazxt4dqcftslp2rwkkkcxy269a35a9pq60ug2q" -NEXT_PUBLIC_FEATURED_VENDING_FACTORY_FLEX_ADDRESS="stars1hvu2ghqkcnvhtj2fc6wuazxt4dqcftslp2rwkkkcxy269a35a9pq60ug2q" +NEXT_PUBLIC_FEATURED_VENDING_FACTORY_FLEX_ADDRESS="stars1udlmmnmmnnqamh36hy6d7azn3ycv23yymkmg6558ntalvyt2pz7s8lhgcd" NEXT_PUBLIC_VENDING_FACTORY_UPDATABLE_FLEX_ADDRESS= # NEXT_PUBLIC_VENDING_IBC_ATOM_FACTORY_ADDRESS= diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 8914678..7086f93 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -161,6 +161,7 @@ const CollectionCreationPage: NextPage = () => { const [baseTokenUri, setBaseTokenUri] = useState(null) const [coverImageUrl, setCoverImageUrl] = useState(null) const [transactionHash, setTransactionHash] = useState(null) + const [isMatchingVendingFactoryPresent, setIsMatchingVendingFactoryPresent] = useState(false) const performVendingMinterChecks = () => { try { @@ -1030,6 +1031,10 @@ const CollectionCreationPage: NextPage = () => { (!isValidAddress(mintingDetails.paymentAddress) || !mintingDetails.paymentAddress.startsWith('stars1')) ) throw new Error('Invalid payment address') + if (!isMatchingVendingFactoryPresent) + throw new Error( + `No matching vending factory contract found for the selected parameters (Mint Price Denom: ${mintingDetails.selectedMintToken?.displayName}, Whitelist Type: ${whitelistDetails?.whitelistType}, Featured Collection: ${isFeaturedCollection})`, + ) } const checkWhitelistDetails = async () => { @@ -1278,7 +1283,9 @@ const CollectionCreationPage: NextPage = () => { minter.flexible === (whitelistDetails?.whitelistType === 'flex') && minter.featured === isFeaturedCollection, )?.factoryAddress + if (vendingFactoryForSelectedDenom) { + setIsMatchingVendingFactoryPresent(true) setVendingFactoryAddress(vendingFactoryForSelectedDenom) const vendingFactoryParameters = await client .queryContractSmart(vendingFactoryForSelectedDenom, { params: {} }) @@ -1300,6 +1307,8 @@ const CollectionCreationPage: NextPage = () => { setMintTokenFromVendingFactory( tokensList.find((token) => token.denom === vendingFactoryParameters?.params?.min_mint_price?.denom), ) + } else { + setIsMatchingVendingFactoryPresent(false) } }, [ collectionDetails?.updatable,