Function: fulfillDeposit(uint256 shares)
This function allows the basket manager to fulfill all pending deposit assets for the current request. The assets are transferred to the basket manager.
Inputs
sharesControl: Fully controlled by the basket manager.
Constraints: Nonzero.
Impact: The amount of shares the current deposit will be fulfilled with.
Branches and code coverage
Intended branches
Set
fulfilledSharesof the current request toshares.Mint
sharesto the basket.Transfer total deposit assets to the basket manager.
Negative behavior
Revert if the caller is not the basket manager.
Revert if
depositRequest.totalDepositAssetsis zero.Revert if
sharesis zero.Revert if the current request has already been fulfilled.
Function call analysis
this._mint(address(this), shares) -> this._update(address(0), account, value) -> ERC20PluginsUpgradeable._update -> ERC20PluginsUpgradeable._updateBalances(address plugin, address from, address to, uint256 amount)
What is controllable?
shares.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.
SafeERC20.safeTransfer(IERC20(this.asset()), msg.sender, assets)
What is controllable? Can increase
assetsby depositing more assets.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.