adobe icon indicating copy to clipboard operation
adobe copied to clipboard

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

Open billythedummy opened this issue 2 years ago • 0 comments

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

billythedummy avatar Aug 30 '22 04:08 billythedummy