Assessment reports>Nukem Loans>Threat Model>_deposit

Function: _deposit(uint256 assets, address receiver)

This facilitates depositing assets into the vault.


  • assets

    • Control: Fully controlled by the caller.

    • Constraints: Checked that enough was transferred in safeTransferFromWithAmount.

    • Impact: The amount of assets to deposit into the vault.

  • receiver

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The address to mint the shares to.

Branches and code coverage (including function calls)

Intended branches

  • Deplete the balance of msg.sender by assets.

  • Increase the balance of address(this) by assets.

  • Mint shares to receiver.

Negative behavior

  • Should not allow depositing more assets than what was transferred. That is ensured in safeTransferFromWithAmount.

  • Should not allow the deposit inflation attack. Currently that is not enforced in code.

Zellic © 2023Back to top ↑