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

IForwarder: provide ability to mark `forward()` as payable #557

Open
sohkai opened this issue Oct 1, 2019 · 1 comment

Comments

@sohkai
Copy link
Member

commented Oct 1, 2019

Needed in situations where a forwarder requires some ETH value to be sent. An example would be the applications implementing IForwarderFee, e.g. Tollgate application, which for now only allows tokens as the fee.

Some potential options:

  1. Provide a different IForwarder interface, e.g. IForwarderPayable (or bundled in IForwarderFee), that marks forward() as payable
  2. Change IForwarder to be an abstract contract, and mark forward() as payable but by default reverting if msg.value > 0; users would then have to override their own forward() and remember to keep the revert if they don't want to accept ETH

It's a little bit ugly, but option 1 seems to be the better choice:

  • Does not introduce changes to already deployed contracts
  • Most apps will not need their forward() function to be payable
@sohkai sohkai added the enhancement label Oct 1, 2019
@izqui

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

I agree that option 1 is better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.