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: Add close_authority and re-enable CloseAccount for non-native Accounts #314

Merged

Conversation

CriesofCarrots
Copy link
Contributor

There are cases when the SOL required for rent at the creation of an SPL token account will be subsidized by a 3rd party, opening the door for a financial attack where users request token accounts from the subsidizer only to immediately close them in order to drain SOL from the subsidizer.

Our previous solution to this attack was to disable CloseAccount for non-native accounts, locking that SOL forever.

This PR re-enables CloseAccount for non-native accounts, and adds an Account::close_authority, enabling a 3rd party as above to reclaim their SOL when an account has 0 token balance.

Also adds a couple clarifying comments to the mint section of process_set_authority

Closes #302
Reverts #127

@CriesofCarrots CriesofCarrots changed the title Token close acct auth token: Add close_authority and re-enable CloseAccount for non-native Accounts Aug 25, 2020
@CriesofCarrots CriesofCarrots merged commit e91725a into solana-labs:master Aug 26, 2020
@CriesofCarrots CriesofCarrots deleted the token-close-acct-auth branch September 24, 2020 19:22
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

Successfully merging this pull request may close these issues.

token: Add CloseAccount authority
3 participants