Assessment reports>Smart Vault>Threat Model>manageDebtAndStake

Function: manageDebtAndStake()

This function is used to manage debt and stake of the smart vault. It is expected to be called from the smart vault manager.

Branches and code coverage

Intended branches

  • Invoke the _manageDebtAndStake function.

  • Skip when staking is disabled.

  • Calculate the underlying token value using the manager's fetchPrice function.

  • Calculate the target staking amount using the staking factor.

    • If the target is greater than the minted, mint the debt token and adjust the staking amount.

    • If the target is less than the minted, burn the debt token and adjust the staking amount.

Negative behavior

  • Revert if caller is not the manager.

  • Revert if the contract is paused.

  • Revert if minting/burning debt token fails.

Function call analysis

  • The external call flows are the same as the depositERC20 function's _manageDebtAndStake flow of SmartVault.

Zellic © 2025Back to top ↑