You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 isspl_token_2022::id()
, ie:solana-program-library/token/program-2022/src/extension/confidential_transfer/processor.rs
Line 1038 in b02468f
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.The text was updated successfully, but these errors were encountered: