Function: _deposit(uint256 assets, address receiver)
This facilitates depositing assets into the vault.
Inputs
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
byassets
.Increase the balance of
address(this)
byassets
.Mint
shares
toreceiver
.
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.