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

Add ERC20 support to SplitPayment #898

Closed
1 task done
frangio opened this issue Apr 17, 2018 · 6 comments
Closed
1 task done

Add ERC20 support to SplitPayment #898

frangio opened this issue Apr 17, 2018 · 6 comments
Labels
contracts Smart contract code.

Comments

@frangio
Copy link
Contributor

frangio commented Apr 17, 2018

SplitPayment allows a group of people to receive ether payments proportionally to their shares. The function claim extracts the correct amount of ether. We should add support to receive ERC20 token payments and for payees to claim them, probably through a claim(ERC20 token) function.

See #859 for a use case.

  • 📈 This is a feature request.
@frangio frangio added good first issue Low hanging fruit for new contributors to get involved! enhancement labels Apr 17, 2018
pw94 added a commit to pw94/zeppelin-solidity that referenced this issue Apr 21, 2018
@pw94
Copy link
Contributor

pw94 commented Apr 21, 2018

Hey, I would like to code it. I have started to do it but I came accross two issues:

  • Would the contract be used to maintain tokens and eth value simultaneously? If so, I should track totalReleased value (eth) and tokenTotalReleased separately as well as released values.
  • Since to use token I need only balanceOf and transfer functions I can use sufficient ERC20Basic instead of ERC20 in claim function?

@frangio
Copy link
Contributor Author

frangio commented Apr 21, 2018

Awesome @pw94!

  1. You should have a mapping (address => uint256) tokenTotalReleased for each token address, as well as mapping (address => mapping (address => uint256)) tokenReleased for each token address for each account.
  2. Yes you could just use ERC20Basic.

pw94 added a commit to pw94/zeppelin-solidity that referenced this issue Apr 21, 2018
pw94 added a commit to pw94/zeppelin-solidity that referenced this issue Apr 22, 2018
@Aniket-Engg
Copy link
Contributor

@frangio This would be great if you can review the PR so that current status of issue can be known.

@nventuro
Copy link
Contributor

nventuro commented Oct 9, 2018

@Aniket-Engg much has changed since that PR was opened, so some updating will need to be done. I'll try to review it during these next couple days.

@frangio frangio added contracts Smart contract code. and removed good first issue Low hanging fruit for new contributors to get involved! labels Jul 12, 2019
@frangio
Copy link
Contributor Author

frangio commented Jul 12, 2019

This is part of a bigger challenge we have of uniformly handling tokens and ether in several of our contracts. We don't have a good design for this yet. Related to #1099.

@frangio
Copy link
Contributor Author

frangio commented Dec 14, 2021

Fixed in #2858.

@frangio frangio closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Smart contract code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants