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

Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide "Transfer Hook Authority" #33938

Closed
andirayo opened this issue Nov 1, 2023 · 2 comments
Labels
community Community contribution

Comments

@andirayo
Copy link

andirayo commented Nov 1, 2023

Versions

  • spl-token-cli 3.2.0
  • solana-cli 1.16.18 (src:612616be; feat:4033350765, client:SolanaLabs)

Problem

It is unclear how the "Transfer Hook Authority" has to be provided to the Solana CLI (spl-token), command set-transfer-hook-program.

Using the option --program-authority transfer-hook-authority-wallet.json does not work. The --program-authority option seems to be ignored and the Solana CLI just uses the default client keypair.

Reproduce

This command failed against Solana DevNet cluster:

spl-token set-transfer-hook-program 2Z2oEHTifRh9qXQXZJtvPzqNW9qPkNZwk77Nj4u8WMgx D5NkkHKzk6G9VGrnyW7Uqt3swiTAwsqvSJdyKsyRUdYc --program-authority admin_account.json

Error message:

Error: "Mint 2Z2oEHTifRh9qXQXZJtvPzqNW9qPkNZwk77Nj4u8WMgx has transfer hook authority 3M42uZcVZb5ynr1oCJEgAnbv2XEmGFjsaAcbJ8ZRCcd4, but FBN8aSfNQi51ownFYjhtWnUKibtGzpm8pvKKaZubH3gU was provided"
  • 3M42uZcVZb5ynr1oCJEgAnbv2XEmGFjsaAcbJ8ZRCcd4 is the pubkey of admin_account.json
  • FBN8aSfNQi51ownFYjhtWnUKibtGzpm8pvKKaZubH3gU is the pubkey of the default client keypair

Notes

The documentation lists

--program-authority <SIGNER>    Specify the authority keypair. Defaults to the client keypair address.
  • It's unclear why the value is described as <SIGNER> because this does not seem to align with the description "Specify the authority keypair.", particularly because usually a keypair is described as <KEYPAIR> (not as <SIGNER>).
  • Providing a keypair / wallet file does not work and/or is ignored.
@andirayo andirayo added the community Community contribution label Nov 1, 2023
@andirayo andirayo changed the title Solana CLI: Command set-transfer-hook-program: Unclear how to provide "Transfer Hook Authority" Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide "Transfer Hook Authority" Nov 1, 2023
@andirayo andirayo changed the title Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide "Transfer Hook Authority" Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide _"Transfer Hook Authority"_ Nov 1, 2023
@andirayo andirayo changed the title Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide _"Transfer Hook Authority"_ Solana CLI spl-token: Command set-transfer-hook-program: Unclear how to provide "Transfer Hook Authority" Nov 1, 2023
@norwnd
Copy link
Contributor

norwnd commented Nov 3, 2023

Hey @andirayo,

  • I can reproduce the issue you are describing, sketched out a PR that possibly resolves it (looks like there is a bug when parsing the parameter you mention): cli: spl-token, fix parameter parsing bug solana-program-library#5722, maybe @joncinque can take a look ?
  • <SIGNER> is typically a synonym for <KEYPAIR>, it refers specifically to "private key" in that key pair (since private key is the key you will be signing this command with)

@buffalojoec
Copy link
Contributor

buffalojoec commented Nov 6, 2023

Thanks for sniffing this one out @andirayo @norwnd ! It should be fixed now after this PR.

In the future, open an issue like this in the SPL repo instead! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants