Function: moveAssetsToProduct(string productName, address vaultAddress, uint256 amount)
This function moves amount of the asset corresponding to the vault identified by productName to the vault from this contract.
Inputs
productNameControl: Full.
Constraints: String must exist in
productsmapping.Impact: This is the contract the vault is looked up in to transfer tokens to.
vaultAddressControl: Full.
Constraints: In the
fcnProduct.receiveAssetsFromCegaStateexternal call, thevaultStartof theFCNVaultMetadatastruct corresponding tovaultAddressis checked to be greater than zero; that is, thevaultAddressmust be an existing vault in thefcnProduct.Impact: This is the address that receives the tokens.
amountControl: Full.
Constraints: The token balance of this contract must be greater than or equal to the
amountvalue or the approval fails.Impact: This is the amount of token to transfer to the
vaultAddress.
Branches and code coverage (including function calls)
Intended branches
Assets are properly transferred to the
vaultAddress.
Negative behaviour
Address
productAddresscannot be zero (i.e.,productNamemust be valid).Contract
CegaStatemust have enough funds.Address
vaultAddressmust be valid, as determined by thefcnProductin the external call tofcnProduct.receiveAssetsFromCegaState.
Function call analysis
moveAssetsToProduct -> receiveAssetsFromCegaState(vaultAddress, amount)What is controllable?: vaultAddress, amount.
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?: Nothing. The function follows the CEI pattern.