7
votes
Accepted
How can I delete all PDA accounts for my program (anchor)?
You can close PDAs using anchor. Here's an example from my own code, closing my Counts PDA:
#[derive(Accounts)]
#[instruction(countsbump: u8)]
pub struct CloseCounts<'info> {
#[account(mut)]
...
2
votes
Accepted
how to delete an element in a Vector Struct at Rust Anchor
In general, iterating through a vector while removing elements is very error-prone. If you have 10 elements in your vector, and you remove the first element, and then you try to remove the 10th ...
1
vote
How can i delete my token?
If this is/was a token account, it sounds like you want to close the account to recover your rent fees. Without code, some wallets (I believe SolFlare) offer the ability to close accounts to recover ...
Only top scored, non community-wiki answers of a minimum length are eligible