Search code examples
solanasolana-web3jssolana-program-library

Is it possible to close an account which was create using SystemProgram.createAccountWithSeed?


I made an error creating an account with seeds. A program is the owner of this account. Is it possible for me to close this or only the program?


Solution

  • Only the owning program may close an account.

    Otherwise, you could use createAccountWithSeed for someone else, and still close their account. For example, you'd create a token account with me as the owner, but then you can close it rather than me. That would be catastrophic!