Affected versions
Summary
During maxRedeem
, internally, the amount is rounded up and in some cases can lead to 1 wei more shares than actually possible to redeem when the amount to redeem is limited by the strategy's withdraw limit.
return min(
# Convert to shares is rounding up so we check against the full balance.
self._convert_to_shares(self._max_withdraw(owner, max_loss, strategies), Rounding.ROUND_UP),
self.balance_of[owner]
)
Impact
If required conditions are met, an attempt by a user to exit their position using the output of maxRedeem
will revert.
Patches
Patch introduced in v3.0.2
Workarounds
If the strategy is not liquid enough to support a user redemption, subtract 1 wei from the the maxRedeem
amount and use it in the redeem
function instead.
Affected versions
Summary
During
maxRedeem
, internally, the amount is rounded up and in some cases can lead to 1 wei more shares than actually possible to redeem when the amount to redeem is limited by the strategy's withdraw limit.Impact
If required conditions are met, an attempt by a user to exit their position using the output of
maxRedeem
will revert.Patches
Patch introduced in v3.0.2
Workarounds
If the strategy is not liquid enough to support a user redemption, subtract 1 wei from the the
maxRedeem
amount and use it in theredeem
function instead.