Function: withdraw(uint256 assets, address receiver, address controller)
This function transfers a user's assets owed for a previously fulfilled redemption request.
Inputs
assetsControl: Fully controlled by the caller.
Constraints: This must match
_maxWithdraw(fulfilledAssets, redeemShares, redeemRequest.totalRedeemShares).Impact: The amount of assets previously requested for redemption.
receiverControl: Fully controlled by the caller.
Constraints: None at this level.
Impact: The address to receive the assets.
controllerControl: Fully controlled by the caller.
Constraints: The caller must be the controller or an operator of the controller.
Impact: The address of the controller of the redeem request.
Branches and code coverage
Intended branches
Set
redeemRequest.redeemShares[controller]to zero.Transfer
assetstoreceiver.
Negative behavior
Revert if the caller is not the controller or an operator of the controller.
Revert if
assetsdoes not match_maxWithdraw(fulfilledAssets, redeemShares, redeemRequest.totalRedeemShares).
Function call analysis
this._claimRedemption(redeemRequest, assets, shares, receiver, controller) -> SafeERC20.safeTransfer(IERC20(this.asset()), receiver, assets)What is controllable?
assets,receiver, andcontroller—sharesis partially controllable by the caller.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.