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

Force defund instruction #613

Open
armaniferrante opened this issue Aug 16, 2021 · 0 comments
Open

Force defund instruction #613

armaniferrante opened this issue Aug 16, 2021 · 0 comments
Labels

Comments

@armaniferrante
Copy link
Member

armaniferrante commented Aug 16, 2021

Currently, a "tombstone" is added to the first 8 bytes of an account when using #[account(close)]. However, this can leave an account in limbo if one closes it and a subsequent instruction immediately refunds it. This is particularly important for PDAs, which are associated with a user, since this effectively means the user can no longer use the contract with a previously used wallet.

To handle this case, we should consider adding an instruction to all Anchor programs that simply checks if a tombstone discriminant is present. If so, send out all lamports to a given, unauthorized destination address.

Related #604.

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

No branches or pull requests

1 participant