Assessment reports>Nukem Loans>Threat Model>_borrowForCollateral

Function: _borrowForCollateral(uint256 amount, address sender)

This borrows collateral (OnlyCollateral).

Inputs

  • amount

    • Control: Full.

    • Constraints: None.

    • Impact: Amount to borrow.

  • sender

    • Control: Full.

    • Constraints: None.

    • Impact: Sender from collateral.

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

  • _borrowForCollateral -> 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.

  • _borrowForCollateral -> market.strategy().borrowFeeFor()

    • What is controllable? Everything.

    • If return value controllable, how is it used and how can it go wrong? Add fee onto borrow.

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

  • _borrowForCollateral -> _swap(amount, msg.sender)

    • What is controllable? Everything.

    • 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.

  • _borrowForCollateral -> _mint(...)

    • What is controllable? Nothing.

    • 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 © 2023Back to top ↑