Should ERC4626 txs revert with zero amounts?
naddison36 opened this issue · 2 comments
naddison36 commented
EIP-4626 does not specify whether deposit
, mint
, withdraw
or redeem
transactions should revert or not if there are zero amounts.
I see the solmate implementation does the following
deposit
will revert if zero sharesmint
will NOT revert if zero assetsredeem
will revert if zero assetswithdraw
will NOT revert if zero shares
Personally, I think ERC4626 contracts should not revert if there are zero amounts returned.
Either way, I think solmate should be consistent with its handling of zero returned amounts of ERC4626 txs. They either all revert or all not revert.
transmissions11 commented
its not about accepting or not accepting zero amounts, its about preventing users fro having their deposits rounded down to 0. that can't happen in the functions without zero checks because they round up.
naddison36 commented
Excellent answer. Thanks