Function: deposit(uint256 assets, address receiver)
If fundsDeployed
is true
, the deposit will be done over _queueDeposit
. It allows any caller to perform deposit of assets tokens and receive the shares. In case fundsDeployed == true
, then the funds will be placed in the deposit queue.
Inputs
assets
Constraints: The caller should own this amount of asset tokens.
Impact: The amount of asset tokens will be deposited.
receiver
Constraints: N/A.
Impact: The receiver of shares.
Branches and code coverage (including function calls)
Intended branches
The balance of the receiver's shares has increased properly.
The asset balance of
msg.sender
decreased byassets
amount.
Negative behavior
The balance of
msg.sender
is less thanassets
.
Function call analysis
_queueDeposit(receiver, assets)
What is controllable?
receiver
andassets
.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? The function is called in case of
fundsDeployed == true
after thedeployPosition
function call by owner. Will revert ifassets
is less thanminDeposit
, ifqueueContract
has not been approved frommsg.sender
.
asset.safeTransferFrom(msg.sender, address(this), assets);
What is controllable? N/A.
If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? Can revert if current contract does not have an approve from
msg.sender
and if balance ofmsg.sender
is less thanassets
amount.
_mint(receiver, shares);
What is controllable?
receiver
.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? There is no problem.
hook.addr.afterDeposit(assets)
What is controllable?
assets
.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? Can reenter but without negative impact because the function is called after all states changes.