Feature SplitPayment contract#417
Conversation
…nd delayed withdrawal from each party
|
We can have an even slimmer SplitPayment contract by removing addPayeeMany and many of the getters that can be implemented by child classes. |
|
I like this idea! I would do a bit of a refactoring, though, and remove the struct. I don't think it's necessary, it would be enough to replace We could even do without the Agree with your comment on getters! Plus removing the struct would remove the need mostly. I like the idea of an overrideable |
|
By the way, Travis failed because we're running tests in Solidity 0.4.13. Unless there's a specific bug in that version that would affect this contract, can you change the pragma line to |
|
Will do the changes, thank you for the feedback! Let me thing about changing the interface to a claim() without distribute(). I didn't want to traverse the array of payees to do the allocation every time a payment is received to avoid extra gas costs to the sender. There might be a different way to do it. |
|
Right, you can solve it without iterating over the array by keeping a variable with the amount of ether that has already been released, and a mapping with how much has been released for each participant. I did something very similar in this TokenVesting contract (#412). Hm, though I don't think this works if the list of participants is dynamic. Do you think it's necessary to be able to add participants after the contract is running? |
|
I updated the contract removing most of the getters and implemented it to resemble how the PullPayment contract works, with a claim() method for payees to take their cut. Please let me know your thoughts. |
|
@abarmat Looks really great! Nice addition. :-) Will merge after Travis finishes. |
…-contract Feature SplitPayment contract
Contract that allows distributing payments done to the registered payees based on their shares.
Expose a distributeFunds function callable by any of the payees to perform the distribution of funds.
Also a SplitPullPayment contract to use PullPayment to allow delayed withdrawal of funds by each payee.