2

When creating a program, it is generally rent-exempt, which allows it to run for 2 years. After this time the SOL of that account is finished and the Garbage collection closes it. So, to avoid this, would it be enough to send SOL to the programId of that program?

1 Answer 1

2

When an account is rent-exempt, it means that no rent is ever taken, which means that it can run indefinitely.

You can read more about rent-exemption at https://docs.solana.com/developing/programming-model/accounts#rent-exemption, and specifically the line:

Program executable accounts are required by the runtime to be rent-exempt to avoid being purged.

2
  • Thanks for the answer :) I have read the docs and my question arises regarding the sentence of "An account is considered rent-exempt if it holds at least 2 years worth of rent". How do I know if my account is rent exempt forever or only for 2 years?
    – cris.sol
    Dec 20, 2022 at 17:24
  • "rent-exempt" means that it never ever pays rent. On top of that, the runtime no longer allows for rent-paying accounts, if an account does not have enough lamports for rent-exemption, the transaction will fail.
    – Jon C
    Dec 20, 2022 at 18:22

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.