The _redeemWTokenPrivate
function is designed to allow users to redeem their wrapped tokens (wTokens) for the underlying collateral tokens by withdrawing from Aave and burning the corresponding wTokens. However, the function currently lacks logic to handle the case where _wTokenAmount
is set to type(uint256).max
, which is intended to represent the user's full balance. This omission could lead to unexpected behavior or errors when users attempt to redeem their entire wToken balance.
The _redeemWTokenPrivate
function does not implement the logic described in its comment, which states:
Currently, the function does not check whether _wTokenAmount
is type(uint256).max
and does not dynamically adjust the redemption amount based on the user's balance.
This means that if a user passes type(uint256).max
as the _wTokenAmount
, the function will attempt to redeem an excessively large amount, which will likely revert due to insufficient balance.
Users expecting to redeem their full balance by passing type(uint256).max
will encounter errors or unexpected behavior.
The impact is Low, the likelihood is Medium, so the severity is Low.
Manual Review
Consider following fix
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.