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

Error handling in ERC20 and ERC721 #1702

Closed
wants to merge 5 commits into from

Conversation

princesinha19
Copy link
Contributor

I did some error handling in ERC20 and ERC721. In every require, I added some messages so that developer or end user can easily understand what's wrong.

Fixes #1701

@princesinha19
Copy link
Contributor Author

@frangio @nventuro Please have a look at this PR. I added message in require statement and also made some changes in ERC20.sol and ERC721.sol. Please let me know If you guys think some changes are need to be done.

@nventuro
Copy link
Contributor

nventuro commented Apr 2, 2019

Hello @princesinha19, thank you for contributing!

We've received multiple requests for this (ever since #888) and will be working on it shortly: see my related comment here for more relevant information.

@princesinha19
Copy link
Contributor Author

okay cools @nventuro

@nventuro
Copy link
Contributor

nventuro commented Apr 2, 2019

Please see this post in our forum for discussion regarding revert reasons, and share your thoughts!

@nventuro
Copy link
Contributor

nventuro commented Apr 5, 2019

@princesinha19 I opened #1709 with some guidelines regarding message format, among other things, including some examples. Could you review it and update your PR accordingly? Thanks!

Copy link
Contributor

@nventuro nventuro 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 for your initiative @princesinha19! I left some comments guiding some of the messages, along with a couple questions. Please review all reason strings according to these. Also, don't forget to append a prefix with the contract name (e.g. 'ERC20: ').

Thanks again!

contracts/token/ERC20/ERC20.sol Outdated Show resolved Hide resolved
contracts/token/ERC20/ERC20.sol Outdated Show resolved Hide resolved
contracts/token/ERC721/ERC721.sol Outdated Show resolved Hide resolved
contracts/token/ERC721/ERC721.sol Outdated Show resolved Hide resolved
contracts/token/ERC721/ERC721.sol Outdated Show resolved Hide resolved
contracts/token/ERC721/ERC721.sol Outdated Show resolved Hide resolved
@princesinha19
Copy link
Contributor Author

thanks, @nventuro for your suggestions.
I made the changes as per your suggestions. Please have a look.

@nventuro
Copy link
Contributor

@princesinha19 to keep things organized, I merged this PR into #1704 (see this commit), while doing some slight modifications to a couple messages, so I'm closing this PR now in favor of the other one.

Thank you very much for your contribution!

@nventuro nventuro closed this Apr 16, 2019
@princesinha19
Copy link
Contributor Author

Okay, no problem. @nventuro

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.

Refactoring function ownerOf in ERC721.sol
2 participants