ERC4626 vault

Hi OZ,

ERC4626 doesn’t revert on deposit if shares returned according to assets is 0. OZ says that if this occurs, it’s basically a donation. What’s the reasoning behind this ? Why not revert on in this case ? Is it because you also want to allow donations without introducing extra function ?

Thank you.

Hello @novaknole

Do you still have the issue

Yeah your point is correct you can use is it for donation to increase the vault value

OZ in the ERC4626 implementation mentions:

The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets will cause the first user to exit to experience reduced losses in detriment to the last users that will experience bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the `_convertToShares` and `_convertToAssets` functions.

I would appreciate what’s the loss in terms of magnitude when decimalOffset is set to 0 and when it’s set to 1.