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

Feature/erc20 erc165 #1073 #1629

Closed

Conversation

utgarda
Copy link

@utgarda utgarda commented Jan 31, 2019

ERC20 made ERC165-compliant (Fixes #1073)

This PR mimics 259b9da and uses test helpers introduced there in a similar manner.

  • fix: ERC20Detailed's name(), symbol(), decimals() made external instead of public

  • feat: add ERC165 to ERC20Burnable

  • feat: add ERC165 to ERC20Detailed

  • feat: add ERC165 to ERC20

Added ERC165 implementation to ERC20, as well as Burnable and Detailed flavors,
didn't touch Capped, Mintable etc., because their functionality is mostly accessible to contract owners.

@come-maiz
Copy link
Contributor

Thanks @utgarda! Please give us some time, we'll review it next week.

@utgarda
Copy link
Author

utgarda commented Feb 7, 2019

@ElOpio is it any good? Can I help you somehow? Obviously, I can't add my own code review to this code :P

@come-maiz
Copy link
Contributor

Hello @utgarda. Sorry it's taking long to review it. Please give the maintainers some time while they catch up with the queue.

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.

Solid work @utgarda!

CHANGELOG.md Outdated
* `ERC20`: added internal `_approve(address owner, address spender, uint256 value)`, allowing derived contracts to set the allowance of arbitrary accounts.
* `ERC20Metadata`: added internal `_setTokenURI(string memory tokenURI)`.

### Improvements:
* `ERC20`: `name()`, `symbol()`, `decimals()` made external instead of public
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't really make this change because it breaks backwards compatibility. What was the reason for it?

Copy link
Author

Choose a reason for hiding this comment

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

@frangio you're right. I followed my reference PR too closely. I'll roll this particular change back.

Copy link
Author

@utgarda utgarda Feb 16, 2019

Choose a reason for hiding this comment

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

@frangio @ElOpio guys, issue fixed. Please review again.

@nventuro
Copy link
Contributor

I'm not sure how (if) we should move forward with this feature: if someone is interacting with an ERC20 token, it seems obvious that it implements the ERC20 interface. What's more interesting is knowing about additional capabilities, e.g. ERC20Mintable, ERC20Burnable, etc. However, this would mean that we'd need to add ERC165 support to pretty much all contracts, and I'm not sure we want to.

If a user requires this, they can easily achieve it by inheriting from ERC165 and calling _registerInterface, which sounds pretty reasonable to me.

@stale
Copy link

stale bot commented Mar 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 30, 2019
@frangio
Copy link
Contributor

frangio commented Apr 1, 2019

After considering this for a while, I don't think we should move forward with adding ERC165 support to ERC20. We haven't received real requests for this, the original issue #1073 was simply a "it would seem to make sense to do this", and I don't think this justifies the added gas cost in the core ERC20 implementation.

Really sorry about the unmerged work @utgarda!

@frangio frangio closed this Apr 1, 2019
@frangio frangio removed the stale label Apr 1, 2019
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

Successfully merging this pull request may close these issues.

Make ERC20 compliant with ERC-165
4 participants