Zero unit token operations in smart contracts #563
littletarzan
started this conversation in
Edits
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Integer rounding will naturally lead to DeFi contracts sometimes minting or transferring 0 units of a token. But the network rejects 0 units in these operations, forcing contract developers to include special cases that would not be necessary on most networks. See the following ERC20 mint token snippet:
Solution
We propose to allow token transfers, mints, and burns to succeed as no-ops when given 0 units of a token. This will align with developer expectations of an ERC-20 contract.
Alternatives
No response
Beta Was this translation helpful? Give feedback.
All reactions