-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Adds indexing event for saving transferFrom and burnFrom transactions. #1264
Conversation
_burnFrom and _transferFrom functions has been changed to TransferFrom event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ardagokcek! Thanks for this suggestion. I know that the lack of spender information in ERC20 events is a problem.
Are you aware of any precedent for this event? I don't want to lightly add an extension of the standard to our base ERC20 implementation.
@@ -104,7 +104,7 @@ contract ERC20 is IERC20 { | |||
balances_[_from] = balances_[_from].sub(_value); | |||
balances_[_to] = balances_[_to].add(_value); | |||
allowed_[_from][msg.sender] = allowed_[_from][msg.sender].sub(_value); | |||
emit Transfer(_from, _to, _value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't remove the Transfer
event from here because it's required by ERC20. If anything we have to add a new event.
@@ -32,4 +32,9 @@ interface IERC20 { | |||
address indexed spender, | |||
uint256 value | |||
); | |||
event TransferFrom( | |||
address indexed executor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usual term for this account is "spender".
Hello @frangio, I really don't think this must %100 be in the ERC20 but I saw a comment in ERC20.sol _burnFrom function and said "It is simple why not just do it." and thank you for the comments about Transfer event, appreciated. This is kind of improvement which only covers token holders who want to check their data with other spenders like exchanges. But as I said it is not an essential improvement that must be in contracts. |
Hi @ardagokcek, thanks for contributing to OpenZeppelin! After considering this for a while, I think the approach suggested in #707 better suits our current needs, since we're not introducing any new non-standard events. I will keep this in mind though when considering how to differentiate Thanks again! |
Fixes #707
🚀 Description
I have added a new indexing Event to save the transfers from another wallet. I know it is not a game changer.
npm run lint:all:fix
).