Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting on approve() if allowance is not 0 is not compliant with ERC-20 interface #6

Open
sohkai opened this issue Jun 3, 2020 · 0 comments

Comments

@sohkai
Copy link
Contributor

sohkai commented Jun 3, 2020

See https://github.com/aragon/minime/blob/master/contracts/MiniMeToken.sol#L232-L236.

Some discussion on this was held in OpenZeppelin: github.com/OpenZeppelin/openzeppelin-contracts/issues/438, and is in the ERC20 spec:

NOTE: To prevent attack vectors like the one described here and discussed here, clients SHOULD make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender. THOUGH The contract itself shouldn't enforce it, to allow backwards compatilibilty with contracts deployed before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant