Assessment reports>Nukem Loans>Threat Model>_mint

Function: _mint(uint256 shares, address receiver)

This facilitates minting shares into the vault.

Inputs

  • shares

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The amount of shares to mint.

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

  • Should not allow for huge discrepancies between previewMint and actual mint. Currently that is not enforced in code.

Zellic © 2024Back to top ↑