-
Notifications
You must be signed in to change notification settings - Fork 12.3k
ERC20 internal transfer method #1370
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
ERC20 internal transfer method #1370
Conversation
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.
Interesting, I like this! I wonder why we didn't do it before?
Note that this will become part of our public API, and as such will need to wait until the next minor release.
|
Yeah I think this makes a lot of sense to have. @k06a I'm curious, have you run into the need to use this? |
|
@frangio @nventuro I browsed the latest version of ERC20.sol and decided this API was missed. Some token creators would like to provide token transfers based on holder signatures for example. A while ago I developed the library for this: https://github.com/bitclave/Feeless. Do you think this kind of functionality could be included in |
|
The redundancy in those lines has come up before, but if you feel we need to revisit the discussion please open a different issue.
Thanks @k06a! |
(cherry picked from commit 43ebb4f)
|
@frangio I think line 98 must be after line 99. When someone edits the _transfer function and doesn't uses require or revert, then line 98 will decrease the allowence but line 99 won't make the transfer. |
|
@ardagokcek I think changing this lines order will not help in this case. You mean someone overrides |
|
Yes, you are true sorry. I was thinking about if someone overrides _transfer and does add some extra controls without any revert only with returning 0. Code is perfect, thank you for describing kindly and for your contribution.
Am 13.10.2018 um 11:24 schrieb Anton Bukov <[email protected]<mailto:[email protected]>>:
@ardagokcek<https://github.com/ardagokcek> I think changing this lines order will not help in this case. You mean someone overrides _transfer? It should revert in case of failure. I used this order of lines because of order of lines 207-209.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1370 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGgZJsLBwyCQTolPXhyZbF8rrZMKy_1jks5ukbE_gaJpZM4XCOdq>.
|
🚀 Description
Allow ERC20 subclasses to perform transfers with own rules. For example by providing senders signature or something else.
Just extracted common
transferandtransferFromcode into internal_transfermethod.npm run lint:fix).