Function: redeem(uint256 shares, address receiver, address controller)
This function transfers a user's assets owed for a previously fulfilled redemption request.
Inputs
sharesControl: Fully controlled by the caller.
Constraints: This must match the claimable redeem request.
Impact: The amount of shares to be claimed.
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
sharesis zero.Revert if the caller is not the controller or an operator of the controller.
Revert if
sharesdoes not match the claimable redeem request.
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.