@@ -25,50 +25,6 @@ interface IPaymentsEscrow {
2525 uint256 thawEndTimestamp;
2626 }
2727
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-
7228 /**
7329 * @notice Emitted when a payer deposits funds into the escrow for a payer-collector-receiver tuple
7430 * @param payer The address of the payer
@@ -152,13 +108,6 @@ interface IPaymentsEscrow {
152108 */
153109 error PaymentsEscrowThawingPeriodTooLong (uint256 thawingPeriod , uint256 maxWaitPeriod );
154110
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-
162111 /**
163112 * @notice Thrown when the contract balance is not consistent with the collection amount
164113 * @param balanceBefore The balance before the collection
@@ -172,54 +121,6 @@ interface IPaymentsEscrow {
172121 */
173122 error PaymentsEscrowInvalidZeroTokens ();
174123
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-
223124 /**
224125 * @notice Deposits funds into the escrow for a payer-collector-receiver tuple, where
225126 * the payer is the transaction caller.
@@ -277,8 +178,6 @@ interface IPaymentsEscrow {
277178 * @notice Collects funds from the payer-collector-receiver's escrow and sends them to {GraphPayments} for
278179 * distribution using the Graph Horizon Payments protocol.
279180 * 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
282181 *
283182 * Emits an {EscrowCollected} event
284183 *
@@ -287,19 +186,20 @@ interface IPaymentsEscrow {
287186 * @param receiver The address of the receiver
288187 * @param tokens The amount of tokens to collect
289188 * @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
291190 */
292191 function collect (
293192 IGraphPayments.PaymentTypes paymentType ,
294193 address payer ,
295194 address receiver ,
296195 uint256 tokens ,
297196 address dataService ,
298- uint256 tokensDataService
197+ uint256 dataServiceCut
299198 ) external ;
300199
301200 /**
302201 * @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.
303203 * @param payer The address of the payer
304204 * @param collector The address of the collector
305205 * @param receiver The address of the receiver
0 commit comments