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

Add extcodesize check to SafeERC20. #1662

Merged
merged 3 commits into from
Mar 6, 2019

Conversation

nventuro
Copy link
Contributor

@nventuro nventuro commented Mar 1, 2019

As noted by @chriseth here, Solidity also performs an extcodesize call on the target address to make sure that it contains code. I've added said check to new the low-level SafeERC20, since we've accidentally removed it in #1655.

As expected, the newly added tests fail if the require(tokenCodeSize > 0) line is removed from the contract.

@nventuro nventuro added bug contracts Smart contract code. labels Mar 1, 2019
@nventuro nventuro added this to the v2.2 milestone Mar 1, 2019
@nventuro nventuro self-assigned this Mar 1, 2019
@nventuro nventuro requested a review from frangio March 1, 2019 18:02
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.

LGTM!

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.

2 participants