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

spl-token withdraw-withheld-tokens silently fails #2224

Closed
tapirtoken opened this issue Jul 21, 2024 · 1 comment
Closed

spl-token withdraw-withheld-tokens silently fails #2224

tapirtoken opened this issue Jul 21, 2024 · 1 comment

Comments

@tapirtoken
Copy link

Problem

If you look at this transaction:

4N1GvNc27DFhKK7Y8dcjMhrDuze4LMfM1qhoG6nkFG2EWTMPEcuevXVGEXmwt6gR55VEskQ9X37Z8RKkP1HhgL8i

You'll notice that instruction #5 (on Solscan) is HarvestWithheldTokensToMint. However, the Withdraw Authority is Null so this operation should normally fail. But this is an exceptional case in which the tokens are being immediately burned (by instruction #6) in the same atomic transaction, so the harvest is allowed in order to permit the wallet owner to recover the rent.

Nevertheless we wanted to make absolutely sure that there was no way to withdraw withheld tokens, so we tried to withdraw our own:

spl-token withdraw-withheld-tokens 8QhMP4HVfUd78hSjwzRXmifYCWAYB2nYiM6Emd7fTstd --fee-payer AirDpo61FVsNDoWSBoBX3K4gcBiTVnkfZRAZk7bKfRtX.json --url mainnet-beta --output json --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --withdraw-withheld-authority AirDpo61FVsNDoWSBoBX3K4gcBiTVnkfZRAZk7bKfRtX.json

This command just terminates as though it succeeded. It definitely didn't succeed because our Withheld Amount on explorer.solana.com is unchanged:

8QhMP4HVfUd78hSjwzRXmifYCWAYB2nYiM6Emd7fTstd

This is correct behavior but withdraw-withheld-tokens should have returned an error message.

Proposed Solution

Just check if the operation succeeded and report to the user.

@joncinque
Copy link

Thanks for the report! This is the incorrect repo, so I've recreated your issue at solana-labs/solana-program-library#7042

@joncinque joncinque closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants