Function: redeemKyc(uint256 shares, address receiver, address owner)
This function is a bridge-only redemption path during the Withdraw phase that burns KYC-approved shares and sends pro-rata USDT to the receiver based on the vault’s available USDT liquidity. It is only callable by the bridge contract during the Withdraw phase.
Inputs
sharesControl: N/A.
Constraints: Must be nonzero, owned/approved by
owner, and only available in the Withdraw phase.Impact: Reduces
sharesKyc, burns the shares, and releases USDT equal to the user’s pro-rata portion.
receiverControl: N/A.
Constraints: N/A.
Impact: Receives the computed USDT amount.
ownerControl: KYC-approved account whose shares are burned.
Constraints:
onlyKycApprovedenforces status andonlyCallerIsBridgeensures the bridge triggers redemption.Impact: Loses shares while their claim in USDT diminishes proportionally.
Branches and code coverage
Intended branches
Burn shares and transfer USDT to the receiver (bridge).
The caller is the bridge contract and calls inside the Withdraw phase.
Negative behavior
The caller is not the bridge contract, and calls outside the Withdraw phase revert.
Function call analysis
this.previewRedeem(owner, shares)What is controllable? N/A.
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(HourglassStableVaultKYC.USDT, receiver, usdtOut)What is controllable? N/A.
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.