Assessment reports>Nukem Loans>Threat Model>liquidate

Function: liquidate(address[] debtors, address liquidator)

This liquidates (already confirmed; only auction).

Inputs

  • debtors

    • Control: Full.

    • Constraints: None.

    • Impact: The debtors.

  • liquidator

    • Control: Full.

    • Constraints: None.

    • Impact: The liquidator.

Branches and code coverage (including function calls)

Intended branches

  • Tips are paid.

  • Sends the user the borrowed assets.

Negative behavior

  • Cannot liquidate zero.

  • Tip cannot be below liquidated.

Function call analysis

  • liquidate(...) -> debt.rebase()

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

  • liquidate(...) -> assetsPerShare()

    • What is controllable? Nothing.

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

  • liquidate(...) -> market.collateral().swap(debtors, this)

    • What is controllable? Debtors.

    • If return value controllable, how is it used and how can it go wrong? Amount received for the unhealthy position.

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

  • liquidate(...) -> (liquidated * strat_.liquidationTip()) / strat_.precision()

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Used to calculate the tip for the liquidator (incentive).

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

  • liquidate(...) -> debt_.erase(debtors[i])

    • What is controllable? Debtors.

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

  • liquidate(...) -> _mint(this, profit_shares)

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