Function: requestDeposit(uint256 assets, address controller, address owner)
This function allows a user to request a deposit of assets to the basket. The assets are immediately transferred to this contract.
Inputs
assetsControl: Fully controlled by the caller.
Constraints: Nonzero.
Impact: The amount of assets to deposit.
controllerControl: Fully controlled by the caller.
Constraints: The
controllermust not have the last pending and claimable deposit request.Impact: The address of the controller of the deposit request being created.
ownerControl: Fully controlled by the caller.
Constraints: None at this level.
Impact: The address of the owner of the assets being deposited.
Branches and code coverage
Intended branches
Check
AssetRegistry(assetRegistry).hasPausedAssets(bitFlag).Update
depositRequestandlastDepositRequestIdmappings.Transfer
owner'sassetsto this contract.
Negative behavior
Revert if
assetsis zero.Revert if
controllerhas the last pending deposit request.Revert if
controllerhas the last claimable deposit request.Revert if any of the assets in the
bitFlagare paused.
Function call analysis
AssetRegistry(this.assetRegistry).hasPausedAssets(this.bitFlag)What is controllable? None.
If the return value is controllable, how is it used and how can it go wrong? A user can request a deposit of paused assets.
What happens if it reverts, reenters or does other unusual control flow? N/A.
SafeERC20.safeTransferFrom(IERC20(this.asset()), owner, address(this), assets)What is controllable?
ownerandassets.If the return value is 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? N/A.