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

[token-js] InitializeMint without FreezeAuthority breaks decodeInitializeMintInstruction #7549

Open
devDesu opened this issue Dec 3, 2024 · 4 comments
Labels
good first issue Good for newcomers

Comments

@devDesu
Copy link

devDesu commented Dec 3, 2024

Example tx: 2LQT3oZSoAyrzAC59wfMfbiZtF74YPcw5rQuaAmBu1FhuVe1f3CZoms8wKETJYVx8q9Bi8wT8v337iMDg4PJysF2

The problem is caused by exact span check here

Proposed solution: check if length of the data is equal to 35 (data with empty freeze authority) or 67 (freeze authority exists) bytes

@joncinque joncinque added the good first issue Good for newcomers label Dec 3, 2024
@joncinque
Copy link
Contributor

Thanks for reporting! This is indeed an issue, and your proposed solution makes sense.

@solana-labs solana-labs deleted a comment Jan 4, 2025
@Danver97
Copy link

Danver97 commented Jan 5, 2025

+1!

This occurs also with InitializeMint2. Example tx: 5VTAodQ23NbVBL4BzQfbsSW7VcCa4h2wuW9eo2ACxhbr2pA4PAUM6Q4ffhH5qgm6xxZGp8c1CruvEgQGR2qecqdK.

The length of data is 35, but the decoding function expects 67.

Danver97 added a commit to Danver97/solana-program-library that referenced this issue Jan 5, 2025
@Danver97 Danver97 mentioned this issue Jan 5, 2025
@Danver97
Copy link

Danver97 commented Jan 5, 2025

Same applies in decodeSetAuthorityInstruction. Expected 35, actual 3.
And everywhere else here: https://github.com/search?q=repo%3Asolana-labs%2Fsolana-program-library%20COptionPublicKeyLayout&type=code.

@Danver97
Copy link

Danver97 commented Jan 5, 2025

PR #7627 should now fix everything

@solana-labs solana-labs deleted a comment Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants
@joncinque @devDesu @Danver97 and others