๐ฅ Consider removing amount != 0 checks
Closed this issue ยท 1 comments
transmissions11 commented
๐ฅ Consider removing amount != 0 checks
StErMi commented
I was thinking about it the other day. It's always a matter of gas optimization and UX tradeoff.
I think that in these cases is fair to make the function "more" expensive by adding a check. In the end, it's the user's fault to use it in a way that it should not be used and I hope that every website would prevent deposit/withdraw 0 amount.
On the other end, removing therequire
check removes some gas cost but introduces a possible way to spam events that in the future could be used for monitoring and creating automatism. Also thinking about the future of ETH and L2 we should hope that gas will lower so some of these optimizations vs UX/security will tend to be more in favor of UX choice