Function: withdraw(IERC20 asset, uint256 vaultTokensToBurn)
This function is used to withdraw assets from the vault.
Inputs
asset
Control: Arbitrary.
Constraints: Only registered assets' address.
Impact: Address of the asset.
vaultTokensToBurn
Control: Arbitrary.
Constraints: None.
Impact: Amount of the vault tokens to burn.
Branches and code coverage
Intended branches
Calculate the amount of asset to return to the user corresponding to the vault tokens to burn.
Transfer the vault tokens to the vault.
Burn the vault tokens of the user.
Negative behavior
Revert if asset is not registered.
Revert if withdraws are disabled.
Revert if the user has not deposited for a minimum number of blocks.
Revert if asset is not transferred to the user.