transmissions11 / solmate

Modern, opinionated, and gas optimized building blocks for smart contract development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should ERC4626 txs revert with zero amounts?

naddison36 opened this issue · comments

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 shares
  • mint will NOT revert if zero assets
  • redeem will revert if zero assets
  • withdraw 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.

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.

Excellent answer. Thanks