Function: repay(uint256 amount, address borrower)
Allows an approved borrower to pay down debt if globalRepayPaused is not paused and repay for borrower is not paused.
Inputs
amountConstraints: Cannot be more than the borrower debt token balance.
Impact: The amount to repay.
borrowerConstraints: Should be an approved borrower.
Impact: The borrower to repay.
Branches and code coverage
Intended branches
The
repaywas executed properly
Negative behavior
borroweraddress is not an approved borrower.amountis more than available.msg.senderdoes not own enough asset tokens to return debt.repayis paused
Function call analysis
debtToken.safeTransferFrom(borrower, address(idleStrategyManager), debtToTransfer)What is controllable?
borrower.If the return value is controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters or does other unusual control flow? Transfer debt tokens from borrower to strategy manager.
asset.safeTransferFrom(from, address(this), repayAmount);What is controllable?
repayAmount.If the return value is controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters or does other unusual control flow? Transfer lent funds from
msg.senderto this contract.