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-2022: Consider removing check_program_account on program id in instruction processors #5909

Open
joncinque opened this issue Nov 28, 2023 · 0 comments

Comments

@joncinque
Copy link
Contributor

Problem

Token-2022 has a generic function for checking that a pubkey matches spl_token_2022::id(). It's typically meant for checking the owner of accounts, but it's also used to make sure that the executing program id is spl_token_2022::id(), ie:

This means that if someone just builds and deploys the program without changing the declare_id!, it won't work. No other program works this way. It should be possible to just build and deploy a program.

Solution

Remove check_program_account in favor of checking against the actual executing program id.

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

No branches or pull requests

1 participant