adobe
adobe copied to clipboard
DRAFT: redesign - track cumulative borrows using a u64 counter instead of a bool flag
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