How to freeze a token account as well as transfer refund out of it without user, signing it by a PDA
How to freeze a token account as well as transfer refund out of it without user, signing it by a PDA
Loading saved threads...
Yellow Wolf · External communityPost link
External question — Solana Stack Exchange
Author: Yellow Wolf
Original post: https://solana.stackexchange.com/questions/24505
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I am trying to make a betting game where users can deposit USDC and play games when they win, the online gets updated and they can withdraw any time and when they lose, the program can take the money to PDA, but when I tried making this, I was unable to assign a away for my program to freeze that much deposited amount as well as have authority to transfer the token out without user signing it and I asked it gave me two complex things. One was a user had SPLUSDC. Then we could assign ourselves as the freeze authority while user is the owner as well as close account which will enable the user to revoke a delegation when we said the amount of depositfor delegation and second if it was to 2022, then we could add permanent delicate extension, is there any other much efficient way to do this?
Quote
Report
Jimii · External communityPost link
External answer — Solana Stack Exchange
Author: Jimii
Original post: https://solana.stackexchange.com/a/24506
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
How to freeze a token account
You need to be the freeze authority over that token account to do this.
as well as transfer refund out of it without user, signing it by a PDA
You can't transfer funds out of any Solana account without having it sign that transaction.
I was unable to assign a away for my program to freeze that much deposited
You can only freeze assets that you have the freeze authority over, i.e assets that you created and assigned yourself the authority. USDC's authority is Circle
https://github.com/solana-program/token/blob/0087ca54bd5a5b07e1df7e1b52303529047a1186/interface/src/state.rs#L29
If you don't want users to sign but you still want to have authority over the accounts, you could generate the keypairs and tell your users to deposit the funds into them. That way you have control over the assets and the user's don't need to sign.
Quote
Report
Post Reply
Checking account access…