Assessment reports>Nukem Loans>Threat Model>computeCollateralizationRatio

Function: computeCollateralizationRatio(address account, uint256 assets)

This calculates an account's collateralization ratio.

Inputs

  • account

    • Control: Full.

    • Constraints: None.

    • Impact: The account.

  • assets

    • Control: Full.

    • Constraints: None.

    • Impact: Number of assets.

Branches and code coverage (including function calls)

Intended branches

  • Computes correctly (tested partially through other indirect calls).

Negative behavior

  • Works with different precision tokens.

Function call analysis

  • computeCollateralizationRatio(account, assets) -> market.strategy().precision()

    • What is controllable? Nothing.

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

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

  • computeCollateralizationRatio(account, assets) -> market.debt().value(account)

    • What is controllable? Everything.

    • If return value controllable, how is it used and how can it go wrong? Amount of debt of the account.

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

Zellic © 2024Back to top ↑