Skip to content

Commit

Permalink
add revert for repay
Browse files Browse the repository at this point in the history
  • Loading branch information
JoscelynFarr committed Feb 26, 2024
1 parent aaab69e commit 6b76d16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/JUSDRepayHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ contract JUSDRepayHelper is Ownable {
IJUSDExchange(JUSDExchange).buyJUSD(USDCBalance, address(this));
}
uint256 balance = IERC20(JUSD).balanceOf(address(this));
uint256 borrowed = IJUSDBank(JusdBank).getBorrowBalance(to);
require(balance <= borrowed, "repayed jusd too much");
IJUSDBank(JusdBank).repay(balance, to);
emit HelpToTransfer(from, to, balance);
}
Expand Down

0 comments on commit 6b76d16

Please sign in to comment.