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

Disallow ERC20._transfer from the zero address. #1752

Merged
merged 10 commits into from
May 16, 2019

Conversation

nventuro
Copy link
Contributor

This came up while reviewing #1751.

The two consequences of this inconsistency were:

  • _transfer was allowed to have from be the zero address
  • a call to transferFrom with from being the zero address reverted, but with an revert reason about setting allowance to the zero address.

@nventuro nventuro added bug contracts Smart contract code. labels May 15, 2019
@nventuro nventuro added this to the v2.3 milestone May 15, 2019
@nventuro nventuro requested a review from frangio May 15, 2019 18:11
test/token/ERC20/ERC20.behavior.js Outdated Show resolved Hide resolved
test/token/ERC20/ERC20.behavior.js Show resolved Hide resolved
test/token/ERC20/ERC20.behavior.js Show resolved Hide resolved
test/token/ERC20/ERC20.test.js Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
nventuro and others added 3 commits May 15, 2019 16:28
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

Thank you @nventuro!

@nventuro nventuro merged commit ad18098 into OpenZeppelin:master May 16, 2019
@nventuro nventuro deleted the erc20-transferfrom-from-zero branch May 16, 2019 14:50
nventuro added a commit that referenced this pull request May 16, 2019
* Add requirement of non-zero from to ERC20 transfer.

* Add test for transferFrom zero address to behavior.

* Create ERC20.transfer behavior.

* Add tests for _transfer.

* Add changelog entry.

* Fix linter error.

* Delete repeated test.

* Fix hardcoded error prefix.

* Update CHANGELOG.md

Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>

* Address review comments.

(cherry picked from commit ad18098)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug contracts Smart contract code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants