Assessment reports>Nukem Loans>Threat Model>borrow

Function: borrow(address account, uint256 amount, uint256 fee)

This borrows onlyDebt.

Inputs

  • account

    • Control: Full.

    • Constraints: None.

    • Impact: The account.

  • amount

    • Control: Full.

    • Constraints: None.

    • Impact: The amount to borrow.

  • fee

    • Control: Full.

    • Constraints: None.

    • Impact: The fee.

Branches and code coverage (including function calls)

Intended branches

  • Limits are respected.

  • Sends the user the borrowed assets.

Negative behavior

  • Slippage enforced.

Function call analysis

  • borrow(...) -> assetsPerShare()

    • What is controllable? Everything.

    • If return value controllable, how is it used and how can it go wrong? Assets per share.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • borrow(...) -> market.debt().mintDebt(account, amount + fee)

    • What is controllable? Full.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • borrow(...) -> asset.safeTransfer(account, amount)

    • What is controllable? Full.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • borrow(...) -> _mint(market, (fee * _base_unit) / assets_per_share)

    • What is controllable? Full.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

Zellic © 2024Back to top ↑