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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃毀 Missing expiry incentive #21

Closed
alecchendev opened this issue Mar 13, 2022 · 0 comments 路 Fixed by #28
Closed

馃毀 Missing expiry incentive #21

alecchendev opened this issue Mar 13, 2022 · 0 comments 路 Fixed by #28
Assignees

Comments

@alecchendev
Copy link
Member

alecchendev commented Mar 13, 2022

Right now people are incentivized to enforce renewals because when funds are transferred, a proportion of that fund is paid to the caller. This is not the case for expiry!

On expiry, it's possible that there are no funds left in the deposit vault, so the caller can only be paid by withdrawing rent from either the deposit vault account or the metadata account, effectively closing the subscription. See #13

Actions:

  • Problem: don't want to withdraw rent/close account if there are tokens left, need some way to get paid. Solution...
    • In Renew, if number of tokens in deposit vault is 0, withdraw rent from subscription and call CloseAccount on token program to close deposit vault
    • In Renew, if number of tokens in deposit vault is >0, take same amount of tokens that you would've taken upon a renewal - if there are less than that, just take whatever's left.
  • Problem: expired accounts that had their rent taken from them need/need not be reinitialized?
    • Option 1: don't let people reinitialize them, whenever initialized is called it only initializes new account (default)
    • Option 2: reinitialize old account
      • reinitialize, need user to pass in count seed
      • Don't increment counter

Also:

  • Add in check_initialized_ata for the payee and caller token accounts if they are already initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant