Assessment reports>Nukem Loans>Threat Model>amountValue

Function: amountValue(uint256 amount_of_assets)

This returns the value of the collateral as stable, using the same precision as the debt collateral.

Inputs

  • amount_of_assets

    • Control: Full.

    • Constraints: None.

    • Impact: Amount of assets.

Branches and code coverage (including function calls)

Intended branches

  • amountValue works as intended and is a conservative value.

Negative behavior

  • Reverts against zero.

Function call analysis

  • amountValue -> debt.totalAssets()

    • What is controllable? Everything.

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

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

  • amountValue -> debt.totalAssets()

    • What is controllable? Everything.

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

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

  • amountValue -> debt.precision()

    • What is controllable? Everything.

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

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

  • amountValue -> swapper.valueOf(debt.asset(), debt_precision)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Value of one debt in stable.

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

  • amountValue -> debt.asset()

    • What is controllable? Everything.

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

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

  • amountValue -> swapper.conservativeValueOf(asset(), amount_of_assets, total_assets)

    • What is controllable? amount_of_assets only.

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

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

Zellic © 2024Back to top ↑