@@ -25,50 +25,6 @@ interface IPaymentsEscrow {
25
25
uint256 thawEndTimestamp;
26
26
}
27
27
28
- /// @notice Details for a payer-collector pair
29
- /// @dev Collectors can be removed only after a thawing period
30
- struct Collector {
31
- // Amount of tokens the collector is allowed to collect
32
- uint256 allowance;
33
- // Timestamp at which the collector thawing period ends (zero if not thawing)
34
- uint256 thawEndTimestamp;
35
- }
36
-
37
- /**
38
- * @notice Emitted when a payer authorizes a collector to collect funds
39
- * @param payer The address of the payer
40
- * @param collector The address of the collector
41
- * @param addedAllowance The amount of tokens added to the collector's allowance
42
- * @param newTotalAllowance The new total allowance after addition
43
- */
44
- event AuthorizedCollector (
45
- address indexed payer ,
46
- address indexed collector ,
47
- uint256 addedAllowance ,
48
- uint256 newTotalAllowance
49
- );
50
-
51
- /**
52
- * @notice Emitted when a payer thaws a collector
53
- * @param payer The address of the payer
54
- * @param collector The address of the collector
55
- */
56
- event ThawCollector (address indexed payer , address indexed collector );
57
-
58
- /**
59
- * @notice Emitted when a payer cancels the thawing of a collector
60
- * @param payer The address of the payer
61
- * @param collector The address of the collector
62
- */
63
- event CancelThawCollector (address indexed payer , address indexed collector );
64
-
65
- /**
66
- * @notice Emitted when a payer revokes a collector authorization.
67
- * @param payer The address of the payer
68
- * @param collector The address of the collector
69
- */
70
- event RevokeCollector (address indexed payer , address indexed collector );
71
-
72
28
/**
73
29
* @notice Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple
74
30
* @param payer The address of the payer
@@ -152,13 +108,6 @@ interface IPaymentsEscrow {
152
108
*/
153
109
error PaymentsEscrowThawingPeriodTooLong (uint256 thawingPeriod , uint256 maxWaitPeriod );
154
110
155
- /**
156
- * @notice Thrown when a collector has insufficient allowance to collect funds
157
- * @param allowance The current allowance
158
- * @param minAllowance The minimum required allowance
159
- */
160
- error PaymentsEscrowInsufficientAllowance (uint256 allowance , uint256 minAllowance );
161
-
162
111
/**
163
112
* @notice Thrown when the contract balance is not consistent with the collection amount
164
113
* @param balanceBefore The balance before the collection
@@ -172,54 +121,6 @@ interface IPaymentsEscrow {
172
121
*/
173
122
error PaymentsEscrowInvalidZeroTokens ();
174
123
175
- /**
176
- * @notice Authorize a collector to collect funds from the payer's escrow
177
- * @dev This function can only be used to increase the allowance of a collector.
178
- * To reduce it the authorization must be revoked and a new one must be created.
179
- *
180
- * Requirements:
181
- * - `allowance` must be greater than zero
182
- *
183
- * Emits an {AuthorizedCollector} event
184
- *
185
- * @param collector The address of the collector
186
- * @param allowance The amount of tokens to add to the collector's allowance
187
- */
188
- function approveCollector (address collector , uint256 allowance ) external ;
189
-
190
- /**
191
- * @notice Thaw a collector's collector authorization
192
- * @dev The thawing period is defined by the `REVOKE_COLLECTOR_THAWING_PERIOD` constant
193
- *
194
- * Emits a {ThawCollector} event
195
- *
196
- * @param collector The address of the collector
197
- */
198
- function thawCollector (address collector ) external ;
199
-
200
- /**
201
- * @notice Cancel a collector's authorization thawing
202
- * @dev Requirements:
203
- * - `collector` must be thawing
204
- *
205
- * Emits a {CancelThawCollector} event
206
- *
207
- * @param collector The address of the collector
208
- */
209
- function cancelThawCollector (address collector ) external ;
210
-
211
- /**
212
- * @notice Revoke a collector's authorization.
213
- * Removes the collector from the list of authorized collectors.
214
- * @dev Requirements:
215
- * - `collector` must have thawed
216
- *
217
- * Emits a {RevokeCollector} event
218
- *
219
- * @param collector The address of the collector
220
- */
221
- function revokeCollector (address collector ) external ;
222
-
223
124
/**
224
125
* @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where
225
126
* the payer is the transaction caller.
@@ -277,8 +178,6 @@ interface IPaymentsEscrow {
277
178
* @notice Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for
278
179
* distribution using the Graph Horizon Payments protocol.
279
180
* The function will revert if there are not enough funds in the escrow.
280
- * @dev Requirements:
281
- * - `collector` needs to be authorized by the payer and have enough allowance
282
181
*
283
182
* Emits an {EscrowCollected} event
284
183
*
@@ -287,19 +186,20 @@ interface IPaymentsEscrow {
287
186
* @param receiver The address of the receiver
288
187
* @param tokens The amount of tokens to collect
289
188
* @param dataService The address of the data service
290
- * @param tokensDataService The amount of tokens that {GraphPayments} should send to the data service
189
+ * @param dataServiceCut The data service cut in PPM that {GraphPayments} should send
291
190
*/
292
191
function collect (
293
192
IGraphPayments.PaymentTypes paymentType ,
294
193
address payer ,
295
194
address receiver ,
296
195
uint256 tokens ,
297
196
address dataService ,
298
- uint256 tokensDataService
197
+ uint256 dataServiceCut
299
198
) external ;
300
199
301
200
/**
302
201
* @notice Get the balance of a payer-collector-receiver tuple
202
+ * This function will return 0 if the current balance is less than the amount of funds being thawed.
303
203
* @param payer The address of the payer
304
204
* @param collector The address of the collector
305
205
* @param receiver The address of the receiver
0 commit comments