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

  • amount

    • Constraints: Cannot be more than the borrower debt token balance.

    • Impact: The amount to repay.

  • borrower

    • Constraints: Should be an approved borrower.

    • Impact: The borrower to repay.

Branches and code coverage

Intended branches

  • The repay was executed properly

Negative behavior

  • borrower address is not an approved borrower.

  • amount is more than available.

  • msg.sender does not own enough asset tokens to return debt.

  • repay is 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.sender to this contract.

Zellic © 2025Back to top ↑