Submitted by d3e4, also found by d3e4
The above code uses yieldVault.convertToAssets() which, per EIP-4626, is only approximate. Especially, it might return too much, and thus _maxYieldVaultWithdraw() might return too much.
_maxYieldVaultWithdraw() is used in maxWithdraw(), in maxRedeem(), and in liquidatableBalanceOf() which functions may thus return too much. In the case of maxWithdraw() and maxRedeem() this violates EIP-4626.
Use yieldVault.previewRedeem(yieldVault.maxRedeem(address(this))).
ERC4626
trmid (PoolTogether) confirmed and commented:
