Hello, I'm building on the ERC4626Fees contract and when testing I think I might have found an issue with the withdraw function. I might be thinking about this wrong and would like to have someone verify if what I'm seeing is right.
The scenario is with a 1% Fee:
User A deposits 100 tokens and is the only depositor
User A receives 99 xTokens
User A calls previewWithdraw - Result is 99.9 Shares.
User A tries to withdraw the assets (99) - Fails because the fee is being added on top of the assets trying to be withdrawn.
This would prevent User A from withdrawing all the assets they are owed via the withdraw function. If you call redeem with the 99 xTokens, it succeeds.
On previewWithdraw/Withdraw should the fee actually be applied to what they will receive, not what they have to send? Otherwise, they would have to somehow call withdraw with more xTokens than they received from their original deposit.