Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding option to mint multiple tokens at once? #363

Closed
WilliamRT95 opened this issue Sep 11, 2021 · 24 comments
Closed

Adding option to mint multiple tokens at once? #363

WilliamRT95 opened this issue Sep 11, 2021 · 24 comments
Labels

Comments

@WilliamRT95
Copy link

Will be great almost necessary to let people mint multiple tokens if they wanted to. As far as I'm concerned we only have the option of "mint_one_token".

Thank you!

@ozyman42
Copy link

In theory we should be able to create one transaction with multiple calls to mint one token, right?

@WilliamRT95
Copy link
Author

As far as Im concerned you have to implement "const signedTxns = await wallet.signAllTransactions(unsignedTxns);" metaplex already has in their marketplace. Will be great if they can implement that to use outside their marketplace. For now we are stuck with mint_one_token, unless you implement it yourself.

@kevinfaveri
Copy link

Hello guys, I've just implemented it in my repo (mintMultipleToken, which receives a param called quantity). It will be multiple transactions but the user will only be prompted once. Check it here: https://github.com/kevinfaveri/solana-candy-factory/blob/main/src/utils/candy-machine.ts#L332

@ozyman42
Copy link

Hello guys, I've just implemented it in my repo (mintMultipleToken, which receives a param called quantity). It will be multiple transactions but the user will only be prompted once. Check it here: https://github.com/kevinfaveri/solana-candy-factory/blob/main/src/utils/candy-machine.ts#L332

Is the whole thing atomic? Meaning it will either all succeed or all fails? Are there scenarios where some fail and others do not? If so how do you track that? This looks promising.

@kevinfaveri
Copy link

It is not atomic, it creates multiple instructions and then sends multiple transactions. However, it does it all on a single signature, meaning the user will only receive a single popup (and not 5 if they are minting five). Since it generates X number of transactions (one for each NFT you want to mint), you can just listen to these transactions to check if they succeeded or failed.

@ozyman42
Copy link

ozyman42 commented Oct 2, 2021

I noticed that Solflare throws a runtime error when trying to call signAllTransactions on the txns generated by your code.

@kevinfaveri
Copy link

Hey @alexleung yeah it might because it does not support big instructions. This is why this is a partial workaround right now, it does not change the fact that the candy machine could implement a program function for that

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

All of a sudden started getting this error from Phantom.

Transaction failed: You cannot unilaterally verify another creator, they must sign

you seeing this too?

@devtimnbr
Copy link

All of a sudden started getting this error from Phantom.

Transaction failed: You cannot unilaterally verify another creator, they must sign

you seeing this too?

Also got this error all of a sudden.

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

I'm assuming Phantom pushed a new update that has an additional validation it once didn't

@swagzhang
Copy link

did u guys fix the problem? I suddenly met same problem, after I mint 16 nfts

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

phantom-ticket

Perhaps a long-shot but I requested that Phantom roll-back to prevent adversely affecting the Solana NFT ecosystem. I don't have time to debug this right now. Please post if you guys figure it out.

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

{
    "InstructionError": [
        4,
        {
            "Custom": 54
        }
    ]
}

there's actually a chance this is coming from Candy Machine itself

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

#611 has this issue

Perhaps #609 is related

@ozyman42
Copy link

ozyman42 commented Oct 4, 2021

fixed by #614

@jordaaash
Copy link
Contributor

Thanks @alexleung. Closing as this has been reported fixed. Please comment if it's still affecting you.

@ozyman42
Copy link

I don't think the original purpose of the issue has been fixed. @jordansexton the issue and fix I mentioned was for an unrelated issue which I originally assumed was related to the temporary code fix which @kevinfaveri provided. Overall this issue is still open until the candy machine smart contract itself supports multiple mints per call.

@jordaaash
Copy link
Contributor

Got it. Thanks for clarifying.

@jordaaash jordaaash reopened this Oct 11, 2021
@Yuriy-Ihor
Copy link

Yuriy-Ihor commented Oct 18, 2021

It is not atomic, it creates multiple instructions and then sends multiple transactions. However, it does it all on a single signature, meaning the user will only receive a single popup (and not 5 if they are minting five). Since it generates X number of transactions (one for each NFT you want to mint), you can just listen to these transactions to check if they succeeded or failed.

Man I haven't tested it yet, but if it works, I love you ❤️❤️❤️ (even if it's not, I still appreciate your work :) )

@Rakeshpradhan1999
Copy link

Can anyone guide me how to setup this https://github.com/kevinfaveri/solana-candy-factory on locally , I am getting error

@Rakeshpradhan1999
Copy link

I want only multiple minting function please guide me if anyone can

@cdric
Copy link

cdric commented Nov 26, 2021

Hey guys. I was able to add support for multiple mints at once (using a similar implementation to the one provided in the Next Candy machine - https://github.com/maxwellfortney/next-candy-machine).

However, since this is sending 5x instructions per mint (5 for 1 mint, 10 for 2 mints, 15 for 3 mints, and so on) to the wallet provided. For some reason the Phantom wallet provide isn't able to compute the transaction cost once the number of instructions exceeds 2 mints (or ~10 instructions). As such the max number of mint I can offer to our users is 2. After that, they won't know how much will be taken from their wallet which is gonna raise a red flag more than anything else (even though the transaction would go through if they approve it). We just can't go live with this limitation.

Also, this seems to be a wallet-specific issue, as with Solflare, the wallet provider breaks down each mint transaction so the user can review that.

From a high level, these are hacks IMHO that have obvious limitations (2 mint max). It would be great if the Metaplex team can provide a native implementation of multiple mints so we don't have to rely on these workarounds that aren't very stable.

Is the Metaplex team considering adding this future in the near future?

Thanks!

@samuelvanderwaal samuelvanderwaal self-assigned this Dec 17, 2021
@github-actions
Copy link

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.

@github-actions github-actions bot added the Stale label Jan 17, 2022
@austbot austbot removed the Stale label Jan 20, 2022
@github-actions
Copy link

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.

@github-actions github-actions bot added the Stale label Feb 20, 2022
@samuelvanderwaal samuelvanderwaal removed their assignment Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests