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

[Bug]: Error Code: LeafAuthorityMustSign when using mpl_bubblegum crate to transfer or burn compressed NFT #1129

Open
ZYJLiu opened this issue Jun 26, 2023 · 1 comment
Labels

Comments

@ZYJLiu
Copy link

ZYJLiu commented Jun 26, 2023

Which package is this bug report for?

bubblegum

Which Type of Package is this bug report for?

mpl_bubblegum crate

Issue description

When using the mpl_bubblegum crate to invoke the transfer or burn instruction on the bubblegum program, the CPI fails with LeafAuthorityMustSign.

Here is a minimal Anchor program to reproduce the issue.
https://github.com/ZYJLiu/anchor-cnft-transfer

It contains two instructions:

  • transfer_one: manually builds the CPI to invoke the bubblegum transfer instruction, which works successfully
  • transfer_two: uses the mpl_bubblegum crate to invoke the bubblegum transfer instruction, which fails with LeafAuthorityMustSign error

There is a .env.example file that should be renamed .env which requires a Helius API key to fetch the asset and asset proof to use in the test.

May require downgrading to solana 1.14 for test to run.
solana-install init 1.14.18

Relevant log output

Error: AnchorError thrown in src/lib.rs:1209. Error Code: LeafAuthorityMustSign. Error Number: 6025. Error Message: This transaction must be signed by either the leaf owner or leaf delegate.

Priority this issue should have

High (immediate attention needed)

@ZYJLiu ZYJLiu added the bug label Jun 26, 2023
@samuelvanderwaal
Copy link
Contributor

Thanks for including a reproducible example in this report--that makes debugging significantly easier. Unfortunately, this is a limitation/bug/known issue with Anchor and using multipl UncheckedAccounts that are optional signers: see this issue coral-xyz/anchor#1899. There may be a way to fix this by creating a transfer_v2 with a different account structure, but otherwise I don't think we can fix transfer without a breaking change, so you'll need to use the manual cpi invoke method for now, sorry!

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

2 participants