Assessment reports>Nukem Loans>Threat Model>_leverage

Function: _leverage(address sender, uint256 _amount)

This leverages a position.

Inputs

  • sender

    • Control: Full.

    • Constraints: None.

    • Impact: The msg.sender from market.

  • _amount

    • Control: Full.

    • Constraints: None.

    • Impact: The amount to leverage.

Branches and code coverage (including function calls)

Intended branches

  • Leverages the user's position.

Negative behavior

  • Zero/boundary checks.

Function call analysis

  • _leverage -> asset_.balanceOf

    • What is controllable? Everything.

    • If return value controllable, how is it used and how can it go wrong? Initial amount of asset.

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

  • _leverage -> market.credit().borrowForCollateral(amount, 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.

  • _leverage -> asset_.balanceOf

    • What is controllable? Everything.

    • If return value controllable, how is it used and how can it go wrong? Post amount of asset.

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

  • _leverage -> _mint(nothing)

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

Zellic © 2024Back to top ↑