Assessment reports>Ethena>Threat Models>handleRepayment

Function: handleRepayment(address user, address onBehalfOf, uint256 amount)

This function manages the repayment process by adjusting a user's debt balance or burning excess from an underlying asset.

Inputs

  • user

    • Constraints: N/A.

    • Impact: The address of the user who is initiating the repayment process.

  • onBehalfOf

    • Constraints: N/A.

    • Impact: This is the address of the account for which the repayment is being made.

  • amount

    • Constraints: N/A.

    • Impact: This is the quantity of tokens that are being repaid.

Branches and code coverage (including function calls)

Intended branches

  • Repayment succeed.

Function call analysis

  • handleRepayment -> _eUSDVariableDebtToken.decreaseBalanceFromInterest(onBehalfOf, amount)

    • External/Internal? External.

    • Argument control? onBehalfOf and amount.

    • Impact: Decrease the amount of interest accumulated by the user.

Zellic © 2024Back to top ↑