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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: redesign - track cumulative borrows using a u64 counter instead of a bool flag #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

billythedummy
Copy link

Suggested Modifications:

  • track borrows by saving the current borrowed amount in the pool account instead of using a boolean flag
  • remove amount arg from repay; the instruction just repays the current borrowed amount saved in the pool account

This should enable safe CPI borrows and repays, including multiple borrows in the same tx. I haven't fully thought through if this change opens new vectors of attack but reducing user input should reduce attack surface.

Just a suggestion, feel free to disregard

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 this pull request may close these issues.

1 participant