The maxRedeem
function should comply with ERC-4626
Description
Tranche should be an ERC-4626--compliant contract. In the ERC-4626 specification, the maxRedeem
function should return the maximum amount of shares that can be redeemed, keeping in mind all redemption limits.
One of the redemption limits that apply to withdrawals is the utilization ratio reserve requirement. Since maxRedeem
is currently not overridden from the underlying ERC-4626 contract, it doesn't consider this requirement, and it needs to be aware of this limit to adjust the return value down if applicable.
Impact
Other contracts or external front-ends expecting ERC-4626 compliance can unexpectedly revert.
Recommendations
Override maxRedeem
with an implementation that considers the reserve ratio requirement.
Remediation
This issue has been acknowledged by Avantis Labs, Inc., and fixes were implemented in the following commits: