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

Emit Approval events from burnFrom and transferFrom (Closes #74) #81

Merged
merged 2 commits into from
Jan 29, 2019

Conversation

truls
Copy link
Contributor

@truls truls commented Jan 26, 2019

No description provided.

@truls truls changed the title Truls/approval events Emit Approval events from burnFrom and transferFrom (Closes #74) Jan 26, 2019
@truls truls requested a review from peteremiljensen January 26, 2019 12:02
@peteremiljensen
Copy link
Member

You cannot tell from an approve event whether it's decreasing or increasing allowance? In other words, it is the same event whether you perform transferFrom or approves a number of tokens?

@truls
Copy link
Contributor Author

truls commented Jan 26, 2019

You cannot tell from an approve event whether it's decreasing or increasing allowance? In other words, it is the same event whether you perform transferFrom or approves a number of tokens?

It is implemented according to OpenZeppelin/openzeppelin-contracts#707 which is referenced by the audit report. I'm not sure if ERC20 defines which events should be emitted and when.

@peteremiljensen
Copy link
Member

peteremiljensen commented Jan 26, 2019

But it looks like you are emitting an event with the transfer/burning value change instead of the new allowance value. You have to emit the new allowance value if you want it to match OpenZeppelin/openzeppelin-contracts#707

So, instead of

emit Approval(from, originSender, value);

you need

emit Approval(from, originSender, _externalERC20Storage.allowed(from, originSender));

@truls truls force-pushed the truls/approval-events branch 2 times, most recently from bc0516c to bbc935f Compare January 27, 2019 17:28
@peteremiljensen peteremiljensen merged commit 198a10e into master Jan 29, 2019
@peteremiljensen peteremiljensen deleted the truls/approval-events branch January 29, 2019 16:49
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.

2 participants