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

relayTokens support in scenarios where ERC677 is used #308

Open
akolotov opened this issue Oct 23, 2019 · 0 comments
Open

relayTokens support in scenarios where ERC677 is used #308

akolotov opened this issue Oct 23, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@akolotov
Copy link
Collaborator

As part of #295 two ways to transfer tokens with specifying an alternative receiver were implemented:

  1. for scenarios where generic ERC20 tokes are involved it is necessary to use sequential pair of approve and relayTokens methods
  2. for scenarios where ERC677 compatible tokens are used it is enough to call transferAndCall

Even if the second way is simpler from a Dapp point of view and does not require two transactions, Dapp still needs to support the first way since generic ERC20 tokens are more widespread. So, in order to operate with both type of tokens the Dapp's developers should maintain two different pieces of code to achieve similar functionality. As a proof that consistency between operations with two different tokens should be kept the following fact can be used: in the past there was a special activity to allow ERC677 tokens used by the bridge behave similarly to generic ERC20 - a user could transfer tokens through the bridge both with transferAndCall and transfer.

That's why it seems logical to support approve-and-relayTokens approach for the bridges where ERC677 tokens are involved together with transferAndCall approach for the scenarios with the alternative receiver.

Additional discussion can be found here.

@akolotov akolotov added the enhancement New feature or request label Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant