Assessment reports>Nukem Loans>Threat Model>execute

Function: execute(address authorizer, address market, address debtor, uint256 block_number, uint256 starts_at, uint256 ends_at, uint256 deadline, uint256 bid, uint8 v, byte[32] r, byte[32] s)

This executes the auction.

Inputs

  • authorizer

    • Control: Full.

    • Constraints: None.

    • Impact: The signer.

  • market

    • Control: Full.

    • Constraints: None.

    • Impact: The relevant market where the liquidation is happening.

  • debtor

    • Control: Full.

    • Constraints: None.

    • Impact: The debtor.

  • block_number

    • Control: Full.

    • Constraints: None.

    • Impact: The block_number of the signature.

  • starts_at

    • Control: Full.

    • Constraints: None.

    • Impact: When the auction starts.

  • ends_at

    • Control: Full.

    • Constraints: None.

    • Impact: When the auction ends.

  • deadline

    • Control: Full.

    • Constraints: None.

    • Impact: The deadline.

  • bid

    • Control: Full.

    • Constraints: None.

    • Impact: The current bid.

  • v

    • Control: Full.

    • Constraints: None.

    • Impact: Signature.

  • r

    • Control: Full.

    • Constraints: None.

    • Impact: Signature.

  • s

    • Control: Full.

    • Constraints: None.

    • Impact: Signature.

Branches and code coverage (including function calls)

Intended branches

  • Timestamp checks work.

  • Cannot liquidate user without enough stable.

Negative behavior

  • Cannot auction healthy positions.

  • Soft/hard liquidations verified against bids.

Function call analysis

  • execute -> _exexute(msg.sender, Auction(...), bid)

    • What is controllable? Nothing (must pass sig checks).

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

  • execute -> _exexute(msg.sender, Auction(...), bid) -> isAuctionable(auction.marker, auction.debtor)

    • What is controllable? Nothing (must pass sig checks).

    • If return value controllable, how is it used and how can it go wrong? Could stop liquidations even in unhealthy positions.

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

  • execute -> _exexute(msg.sender, Auction(...), bid) -> currentPrice(...)

    • What is controllable? Nothing (must pass sig checks).

    • If return value controllable, how is it used and how can it go wrong? Make liquidations unprofitable, resulting in unhealthy positions.

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

  • execute -> _exexute(msg.sender, Auction(...), bid) -> market.collateral().swappableValue(auction.debtor)

    • What is controllable? Nothing (must pass sig checks).

    • If return value controllable, how is it used and how can it go wrong? The return value is controllable and affects what type of liquidation it is --- controllable by manipulating the underlying pool.

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

  • execute -> _exexute(msg.sender, Auction(...), bid) -> market.credit().liquidate(debtors, account)

    • What is controllable? Nothing (must pass sig checks).

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

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

  • execute -> _exexute(msg.sender, Auction(...), bid) -> market.credit().auction(account, bid, auction.debtor)

    • What is controllable? Only bid, everything else is checked against signature.

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

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

Zellic © 2024Back to top ↑