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

Fix decrease allowance and add non-zero address precondition to approve #1293

Merged

Conversation

frangio
Copy link
Contributor

@frangio frangio commented Sep 6, 2018

decreaseAllowance now requires the current allowance to not be larger than the amount to decrease. If the intent is to decrease the allowance to 0, approve(0) should be used instead.

Fixes #437.

Additionally adds a check that an address is non-zero, which is the convention across OpenZeppelin.

Tests need fixed.

@frangio frangio added this to the v2.0 milestone Sep 6, 2018
@frangio frangio added kind:improvement contracts Smart contract code. breaking change Changes that break backwards compatibility of the public API. and removed status:in-progress labels Sep 7, 2018
Copy link
Contributor

@wjmelements wjmelements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much havoc from one change, wow

@wjmelements
Copy link
Contributor

So much havoc from one change, wow

This is in reference to f306cc8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method decreaseApproval in unsafe
3 participants