Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Support ERC677 for ERC20 deposit #351

Open
wighawag opened this issue Mar 26, 2021 · 2 comments
Open

Support ERC677 for ERC20 deposit #351

wighawag opened this issue Mar 26, 2021 · 2 comments
Labels
Category: Enhancement New feature or request

Comments

@wighawag
Copy link

Is your feature request related to a problem? Please describe.
With the current design of the ERC20 Gateway, the user have to first approve the gateway to allow it to transfer the token on its behalf.

Describe the solution you'd like
If the gateway would support ERC677 function onTokenTransfer(address, uint, bytes calldata) external returns (bool); then users could simply call transferAndCall and be done

ERC677 is a defacto standard being used by WETH10

Describe alternatives you've considered
An alternative that would also be great to have is for the deposit function to accept a signature so it can call EIP-2612 permit if needed

@gakonst
Copy link
Contributor

gakonst commented Mar 26, 2021

I'm more a fan of permit than adding callbacks and think that having a depositWithSignature method could make sense.

@gakonst gakonst added the Category: Enhancement New feature or request label Mar 26, 2021
@wighawag
Copy link
Author

Permit is great so I would also vote to get it supported.

But I think as a generic gateway, it should dictate as less as possible what is accepted and let developers chose what is best for them. Hence why I vote for both :)

I would also vote for having it in the L2 generic ERC20 token but that is another issue.

In term of UX they are ultimately equivalent (metamask could batch the signature and tx in one popup and ERC677 could be supported so that wallet show the actually data being encoded) but as it stands, both have disadvantage and advantages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants