seeds = 
        payer = sender,
        space = 90
    pub freezing_config : Account<'info,FreezingConfig>,

What seeds should i add to make the account unique everty time for the same mint address?

can anyone share how can i close this account with a small snippet?

  • These are two separate questions. If you link me another question that you post I'll be happy to answer each question individually.
    – NHeinDev
    Commented Aug 10, 2022 at 14:08

1 Answer 1


Here is the "recommended" example to close an account from common sealevel-attacks, there are also examples of "insecure" and "secure" ways to close an account to review if you are interested:


pub mod closing_accounts_recommended {
    use super::*;

    pub fn close(ctx: Context<Close>) -> ProgramResult {

pub struct Close<'info> {
    #[account(mut, close = destination)]
    account: Account<'info, Data>,
    destination: AccountInfo<'info>,

pub struct Data {
    data: u64,
  • 1
    is there a generic way to close an account without having to define his corresponding struct Data? It would be really handy for situations where the struct of an account has changed and you want to get rid of old accounts with the "wrong" data structure.
    – Ander
    Commented Oct 18, 2022 at 6:19
  • How comes this approach doesn't need seeds or bump? I thought it was required when using PDA accounts. Commented Oct 18, 2022 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.