From 0f1bad2edb39860958dcd8accc5e512d237fa8c5 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Fri, 23 Jun 2023 02:27:16 +0300 Subject: [PATCH 01/12] Account for zero airdrop fees for open edition collections --- contracts/openEditionMinter/contract.ts | 27 ++++++------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/contracts/openEditionMinter/contract.ts b/contracts/openEditionMinter/contract.ts index 8088abc..df99013 100644 --- a/contracts/openEditionMinter/contract.ts +++ b/contracts/openEditionMinter/contract.ts @@ -361,7 +361,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin 'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.', ) } - console.log((Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100) + const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps) const res = await client.execute( senderAddress, contractAddress, @@ -370,12 +370,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin }, 'auto', '', - [ - coin( - (Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100, - 'ustars', - ), - ], + airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [], ) return res.transactionHash }) @@ -396,7 +391,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin 'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.', ) } - + const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps) const executeContractMsgs: MsgExecuteContractEncodeObject[] = [] for (let i = 0; i < batchNumber; i++) { const msg = { @@ -408,12 +403,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin sender: senderAddress, contract: contractAddress, msg: toUtf8(JSON.stringify(msg)), - funds: [ - coin( - (Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100, - 'ustars', - ), - ], + funds: airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [], }), } @@ -441,7 +431,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin 'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.', ) } - + const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps) const executeContractMsgs: MsgExecuteContractEncodeObject[] = [] for (let i = 0; i < recipients.length; i++) { const msg = { @@ -453,12 +443,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin sender: senderAddress, contract: contractAddress, msg: toUtf8(JSON.stringify(msg)), - funds: [ - coin( - (Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100, - 'ustars', - ), - ], + funds: airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [], }), } From 44871ab685982756c07d2eafa4268a51313ad55d Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 28 Jun 2023 18:24:43 +0300 Subject: [PATCH 02/12] Automatically open Studio Survey sidetab upon collection creation --- pages/collections/create.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 2f6e2ab..ca0f439 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -81,6 +81,7 @@ const CollectionCreationPage: NextPage = () => { baseFactory: baseFactoryContract, } = useContracts() const scrollRef = useRef(null) + const sidetabRef = useRef(null) const vendingFactoryMessages = useMemo( () => vendingFactoryContract?.use(VENDING_FACTORY_ADDRESS), @@ -1107,8 +1108,11 @@ const CollectionCreationPage: NextPage = () => { vendingMinterContractAddress !== null || openEditionMinterDetails?.openEditionMinterContractAddress || isMintingComplete - ) + ) { scrollRef.current?.scrollIntoView({ behavior: 'smooth' }) + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + if (sidetabRef.current) sidetabRef.current.open() + } }, [vendingMinterContractAddress, openEditionMinterDetails?.openEditionMinterContractAddress, isMintingComplete]) useEffect(() => { @@ -1600,7 +1604,14 @@ const CollectionCreationPage: NextPage = () => { Mint & Add Token(s) - + From 64246a3ed4bac1748355798699fde33516a64f6a Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 28 Jun 2023 20:59:51 +0300 Subject: [PATCH 03/12] Update sidebar links --- components/Sidebar.tsx | 8 ++++---- utils/links.ts | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 1c0df60..99d6bce 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -44,7 +44,7 @@ export const Sidebar = () => { {/* main navigation routes */} -
+