File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ interface IPaymentCombinerFunctions {
37
37
* Get the list of pending shares for a payee.
38
38
* @param payee The address of the payee
39
39
* @param tokenAddr The address of the ERC-20 token. If the token address is 0x0, then the native token is used.
40
- * @param splitterAddrs The list of payments splitters to check
40
+ * @param splitterAddrs The list of payments splitters to check. If empty then all splitters are used.
41
41
* @return pendingShares The list of pending shares
42
42
* @dev The list includes zero balances. These should be removed before releasing shares.
43
43
*/
@@ -50,8 +50,9 @@ interface IPaymentCombinerFunctions {
50
50
* Release the pending shares for a payee.
51
51
* @param payee The address of the payee
52
52
* @param tokenAddr The address of the ERC-20 token. If the token address is 0x0, then the native token is used.
53
- * @param splitterAddrs The list of payments splitters to release shares from
54
- * @dev Use the listReleasableSplitters function to get the list of splitters and pending shares
53
+ * @param splitterAddrs The list of payments splitters to release shares from. If empty then all splitters are used.
54
+ * @dev Use the above functions to get the list of splitters and pending shares.
55
+ * @dev Calling splitters with no shares to release will fail.
55
56
*/
56
57
function release (address payable payee , address tokenAddr , address [] calldata splitterAddrs ) external ;
57
58
}
Original file line number Diff line number Diff line change @@ -73,6 +73,11 @@ contract PaymentCombiner is IPaymentCombiner, IERC165 {
73
73
returns (uint256 [] memory pendingShares )
74
74
{
75
75
uint256 len = splitterAddrs.length ;
76
+ if (len == 0 ) {
77
+ splitterAddrs = _payeeSplitters[payee];
78
+ len = splitterAddrs.length ;
79
+ }
80
+
76
81
uint256 [] memory payeePendingShares = new uint256 [](len);
77
82
78
83
if (tokenAddr == address (0 )) {
@@ -98,6 +103,11 @@ contract PaymentCombiner is IPaymentCombiner, IERC165 {
98
103
/// @inheritdoc IPaymentCombinerFunctions
99
104
function release (address payable payee , address tokenAddr , address [] calldata splitterAddrs ) external {
100
105
uint256 len = splitterAddrs.length ;
106
+ if (len == 0 ) {
107
+ splitterAddrs = _payeeSplitters[payee];
108
+ len = splitterAddrs.length ;
109
+ }
110
+
101
111
if (tokenAddr == address (0 )) {
102
112
for (uint256 i = 0 ; i < len;) {
103
113
PaymentSplitter (payable (splitterAddrs[i])).release (payee);
You can’t perform that action at this time.
0 commit comments