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
assetsConstraints: The caller should own this amount of asset tokens.
Impact: The amount of asset tokens will be deposited.
receiverConstraints: 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.senderdecreased byassetsamount.
Negative behavior
The balance of
msg.senderis less thanassets.
Function call analysis
_queueDeposit(receiver, assets)What is controllable?
receiverandassets.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 == trueafter thedeployPositionfunction call by owner. Will revert ifassetsis less thanminDeposit, ifqueueContracthas 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.senderand if balance ofmsg.senderis less thanassetsamount.
_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.