Function: previewRedeem(address user, uint256 shares)
This function is a view helper returning the amounts a user would receive for burning shares; non-KYC users receive USDC 1:1, while KYC users receive pro-rata USDT and undeployed USDC based on the KYC pool balances.
Inputs
userControl: N/A.
Constraints: Reverts if
sharesexceed the user’s balance.Impact: Determines whether the KYC or non-KYC branch is used.
sharesControl: N/A.
Constraints: Must not exceed the user’s balance.
Impact: Directly drives the computed USDC/USDT amounts.
Branches and code coverage
Intended branches
If the user is KYC-approved, returns
(pro-rata USDT, pro-rata undeployed USDC, true).Otherwise returns
(0, shares, false)for the non-KYC refund path.
Negative behavior
Reverts when the user lacks enough shares.
Function call analysis
None.